
(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 13 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 (+ (* (* z a) b) (+ (* t a) (+ x (* y z)))))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * a) * b) + ((t * a) + (x + (y * z)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * a) * b) + ((t * a) + (x + (y * z)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * a) * b) + ((t * a) + (x + (y * z))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * a) * b) + Float64(Float64(t * a) + Float64(x + Float64(y * z)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * a) * b) + ((t * a) + (x + (y * z))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b + \left(t \cdot a + \left(x + y \cdot z\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 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%
associate-*l*16.7%
Simplified16.7%
Taylor expanded in z around inf 100.0%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -8.5e+68)
t_1
(if (<= z -4.2e-222)
x
(if (<= z 1.95e-206)
(* t a)
(if (<= z 2.65e-98)
x
(if (<= z 0.32)
(* t a)
(if (<= z 4e+37) x (if (<= z 3.1e+47) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -8.5e+68) {
tmp = t_1;
} else if (z <= -4.2e-222) {
tmp = x;
} else if (z <= 1.95e-206) {
tmp = t * a;
} else if (z <= 2.65e-98) {
tmp = x;
} else if (z <= 0.32) {
tmp = t * a;
} else if (z <= 4e+37) {
tmp = x;
} else if (z <= 3.1e+47) {
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 = a * (z * b)
if (z <= (-8.5d+68)) then
tmp = t_1
else if (z <= (-4.2d-222)) then
tmp = x
else if (z <= 1.95d-206) then
tmp = t * a
else if (z <= 2.65d-98) then
tmp = x
else if (z <= 0.32d0) then
tmp = t * a
else if (z <= 4d+37) then
tmp = x
else if (z <= 3.1d+47) 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 = a * (z * b);
double tmp;
if (z <= -8.5e+68) {
tmp = t_1;
} else if (z <= -4.2e-222) {
tmp = x;
} else if (z <= 1.95e-206) {
tmp = t * a;
} else if (z <= 2.65e-98) {
tmp = x;
} else if (z <= 0.32) {
tmp = t * a;
} else if (z <= 4e+37) {
tmp = x;
} else if (z <= 3.1e+47) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -8.5e+68: tmp = t_1 elif z <= -4.2e-222: tmp = x elif z <= 1.95e-206: tmp = t * a elif z <= 2.65e-98: tmp = x elif z <= 0.32: tmp = t * a elif z <= 4e+37: tmp = x elif z <= 3.1e+47: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -8.5e+68) tmp = t_1; elseif (z <= -4.2e-222) tmp = x; elseif (z <= 1.95e-206) tmp = Float64(t * a); elseif (z <= 2.65e-98) tmp = x; elseif (z <= 0.32) tmp = Float64(t * a); elseif (z <= 4e+37) tmp = x; elseif (z <= 3.1e+47) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -8.5e+68) tmp = t_1; elseif (z <= -4.2e-222) tmp = x; elseif (z <= 1.95e-206) tmp = t * a; elseif (z <= 2.65e-98) tmp = x; elseif (z <= 0.32) tmp = t * a; elseif (z <= 4e+37) tmp = x; elseif (z <= 3.1e+47) tmp = 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[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+68], t$95$1, If[LessEqual[z, -4.2e-222], x, If[LessEqual[z, 1.95e-206], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.65e-98], x, If[LessEqual[z, 0.32], N[(t * a), $MachinePrecision], If[LessEqual[z, 4e+37], x, If[LessEqual[z, 3.1e+47], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-222}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-206}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-98}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 0.32:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+47}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.49999999999999966e68 or 3.1000000000000001e47 < z Initial program 86.5%
associate-+l+86.5%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in z around inf 81.3%
Taylor expanded in a around inf 49.4%
Taylor expanded in z around 0 46.7%
if -8.49999999999999966e68 < z < -4.1999999999999998e-222 or 1.95000000000000004e-206 < z < 2.65000000000000015e-98 or 0.320000000000000007 < z < 3.99999999999999982e37Initial program 99.9%
associate-+l+99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 53.5%
if -4.1999999999999998e-222 < z < 1.95000000000000004e-206 or 2.65000000000000015e-98 < z < 0.320000000000000007 or 3.99999999999999982e37 < z < 3.1000000000000001e47Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 87.8%
Taylor expanded in a around inf 63.2%
Final simplification52.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -8.5e+68)
t_1
(if (<= z -6e-221)
x
(if (<= z 1.7e-209)
(* t a)
(if (<= z 5.5e-98)
x
(if (<= z 4.7e-10)
(* t a)
(if (<= z 3.95e+37) x (if (<= z 7.1e+47) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -8.5e+68) {
tmp = t_1;
} else if (z <= -6e-221) {
tmp = x;
} else if (z <= 1.7e-209) {
tmp = t * a;
} else if (z <= 5.5e-98) {
tmp = x;
} else if (z <= 4.7e-10) {
tmp = t * a;
} else if (z <= 3.95e+37) {
tmp = x;
} else if (z <= 7.1e+47) {
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 = z * (a * b)
if (z <= (-8.5d+68)) then
tmp = t_1
else if (z <= (-6d-221)) then
tmp = x
else if (z <= 1.7d-209) then
tmp = t * a
else if (z <= 5.5d-98) then
tmp = x
else if (z <= 4.7d-10) then
tmp = t * a
else if (z <= 3.95d+37) then
tmp = x
else if (z <= 7.1d+47) 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 = z * (a * b);
double tmp;
if (z <= -8.5e+68) {
tmp = t_1;
} else if (z <= -6e-221) {
tmp = x;
} else if (z <= 1.7e-209) {
tmp = t * a;
} else if (z <= 5.5e-98) {
tmp = x;
} else if (z <= 4.7e-10) {
tmp = t * a;
} else if (z <= 3.95e+37) {
tmp = x;
} else if (z <= 7.1e+47) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -8.5e+68: tmp = t_1 elif z <= -6e-221: tmp = x elif z <= 1.7e-209: tmp = t * a elif z <= 5.5e-98: tmp = x elif z <= 4.7e-10: tmp = t * a elif z <= 3.95e+37: tmp = x elif z <= 7.1e+47: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -8.5e+68) tmp = t_1; elseif (z <= -6e-221) tmp = x; elseif (z <= 1.7e-209) tmp = Float64(t * a); elseif (z <= 5.5e-98) tmp = x; elseif (z <= 4.7e-10) tmp = Float64(t * a); elseif (z <= 3.95e+37) tmp = x; elseif (z <= 7.1e+47) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -8.5e+68) tmp = t_1; elseif (z <= -6e-221) tmp = x; elseif (z <= 1.7e-209) tmp = t * a; elseif (z <= 5.5e-98) tmp = x; elseif (z <= 4.7e-10) tmp = t * a; elseif (z <= 3.95e+37) tmp = x; elseif (z <= 7.1e+47) tmp = t * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+68], t$95$1, If[LessEqual[z, -6e-221], x, If[LessEqual[z, 1.7e-209], N[(t * a), $MachinePrecision], If[LessEqual[z, 5.5e-98], x, If[LessEqual[z, 4.7e-10], N[(t * a), $MachinePrecision], If[LessEqual[z, 3.95e+37], x, If[LessEqual[z, 7.1e+47], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-221}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-209}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-98}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-10}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.1 \cdot 10^{+47}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.49999999999999966e68 or 7.1000000000000002e47 < z Initial program 86.5%
associate-+l+86.5%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in z around inf 81.3%
Taylor expanded in a around inf 49.4%
if -8.49999999999999966e68 < z < -6.0000000000000003e-221 or 1.69999999999999994e-209 < z < 5.4999999999999997e-98 or 4.7000000000000003e-10 < z < 3.9500000000000001e37Initial program 99.9%
associate-+l+99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 53.5%
if -6.0000000000000003e-221 < z < 1.69999999999999994e-209 or 5.4999999999999997e-98 < z < 4.7000000000000003e-10 or 3.9500000000000001e37 < z < 7.1000000000000002e47Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around inf 87.8%
Taylor expanded in a around inf 63.2%
Final simplification53.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -7.5e+174)
(+ x (+ (* (* z a) b) (* t a)))
(if (<= b 8e+238)
(+ (+ (* t a) (* a (* z b))) (+ x (* y z)))
(+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -7.5e+174) {
tmp = x + (((z * a) * b) + (t * a));
} else if (b <= 8e+238) {
tmp = ((t * a) + (a * (z * b))) + (x + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-7.5d+174)) then
tmp = x + (((z * a) * b) + (t * a))
else if (b <= 8d+238) then
tmp = ((t * a) + (a * (z * b))) + (x + (y * z))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -7.5e+174) {
tmp = x + (((z * a) * b) + (t * a));
} else if (b <= 8e+238) {
tmp = ((t * a) + (a * (z * b))) + (x + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -7.5e+174: tmp = x + (((z * a) * b) + (t * a)) elif b <= 8e+238: tmp = ((t * a) + (a * (z * b))) + (x + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -7.5e+174) tmp = Float64(x + Float64(Float64(Float64(z * a) * b) + Float64(t * a))); elseif (b <= 8e+238) tmp = Float64(Float64(Float64(t * a) + Float64(a * Float64(z * b))) + Float64(x + Float64(y * z))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -7.5e+174) tmp = x + (((z * a) * b) + (t * a)); elseif (b <= 8e+238) tmp = ((t * a) + (a * (z * b))) + (x + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -7.5e+174], N[(x + N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e+238], N[(N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+174}:\\
\;\;\;\;x + \left(\left(z \cdot a\right) \cdot b + t \cdot a\right)\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+238}:\\
\;\;\;\;\left(t \cdot a + a \cdot \left(z \cdot b\right)\right) + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -7.5000000000000004e174Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
*-commutative97.3%
associate-*l*75.2%
distribute-lft-out75.2%
fma-def75.2%
+-commutative75.2%
fma-def75.2%
Simplified75.2%
Taylor expanded in y around 0 74.1%
distribute-lft-in74.1%
*-commutative74.1%
*-commutative74.1%
associate-*l*93.8%
Applied egg-rr93.8%
if -7.5000000000000004e174 < b < 8.0000000000000004e238Initial program 96.1%
associate-+l+96.1%
associate-*l*96.0%
Simplified96.0%
if 8.0000000000000004e238 < b Initial program 66.7%
associate-+l+66.7%
+-commutative66.7%
*-commutative66.7%
associate-*l*66.7%
distribute-lft-out86.7%
fma-def86.7%
+-commutative86.7%
fma-def86.7%
Simplified86.7%
Taylor expanded in y around 0 93.3%
Final simplification95.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -8.5e+68)
t_1
(if (<= z -4.7e-66)
(+ x (* y z))
(if (<= z 1.7e+54) (+ x (* t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -8.5e+68) {
tmp = t_1;
} else if (z <= -4.7e-66) {
tmp = x + (y * z);
} else if (z <= 1.7e+54) {
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 = z * (y + (a * b))
if (z <= (-8.5d+68)) then
tmp = t_1
else if (z <= (-4.7d-66)) then
tmp = x + (y * z)
else if (z <= 1.7d+54) 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 = z * (y + (a * b));
double tmp;
if (z <= -8.5e+68) {
tmp = t_1;
} else if (z <= -4.7e-66) {
tmp = x + (y * z);
} else if (z <= 1.7e+54) {
tmp = x + (t * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -8.5e+68: tmp = t_1 elif z <= -4.7e-66: tmp = x + (y * z) elif z <= 1.7e+54: tmp = x + (t * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -8.5e+68) tmp = t_1; elseif (z <= -4.7e-66) tmp = Float64(x + Float64(y * z)); elseif (z <= 1.7e+54) 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 = z * (y + (a * b)); tmp = 0.0; if (z <= -8.5e+68) tmp = t_1; elseif (z <= -4.7e-66) tmp = x + (y * z); elseif (z <= 1.7e+54) 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[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+68], t$95$1, If[LessEqual[z, -4.7e-66], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+54], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-66}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+54}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.49999999999999966e68 or 1.7e54 < z Initial program 86.2%
associate-+l+86.2%
associate-*l*78.6%
Simplified78.6%
Taylor expanded in z around inf 81.9%
if -8.49999999999999966e68 < z < -4.6999999999999999e-66Initial program 99.9%
associate-+l+99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.8%
if -4.6999999999999999e-66 < z < 1.7e54Initial program 100.0%
associate-+l+100.0%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in z around 0 78.1%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7e+97) (not (<= z 2.85e+107))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7e+97) || !(z <= 2.85e+107)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-7d+97)) .or. (.not. (z <= 2.85d+107))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7e+97) || !(z <= 2.85e+107)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7e+97) or not (z <= 2.85e+107): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7e+97) || !(z <= 2.85e+107)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7e+97) || ~((z <= 2.85e+107))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7e+97], N[Not[LessEqual[z, 2.85e+107]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+97} \lor \neg \left(z \leq 2.85 \cdot 10^{+107}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -7.0000000000000001e97 or 2.84999999999999986e107 < z Initial program 83.8%
associate-+l+83.8%
associate-*l*74.8%
Simplified74.8%
Taylor expanded in z around inf 85.5%
if -7.0000000000000001e97 < z < 2.84999999999999986e107Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.4%
distribute-lft-out99.4%
fma-def99.4%
+-commutative99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in y around 0 84.3%
Final simplification84.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.5e+21) (not (<= a 1.15e-104))) (+ x (* a (+ t (* z b)))) (+ (* t a) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.5e+21) || !(a <= 1.15e-104)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (t * a) + (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.5d+21)) .or. (.not. (a <= 1.15d-104))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (t * a) + (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.5e+21) || !(a <= 1.15e-104)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (t * a) + (x + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.5e+21) or not (a <= 1.15e-104): tmp = x + (a * (t + (z * b))) else: tmp = (t * a) + (x + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.5e+21) || !(a <= 1.15e-104)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(t * a) + 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.5e+21) || ~((a <= 1.15e-104))) tmp = x + (a * (t + (z * b))); else tmp = (t * a) + (x + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.5e+21], N[Not[LessEqual[a, 1.15e-104]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+21} \lor \neg \left(a \leq 1.15 \cdot 10^{-104}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\
\end{array}
\end{array}
if a < -4.5e21 or 1.15e-104 < a Initial program 90.2%
associate-+l+90.2%
+-commutative90.2%
*-commutative90.2%
associate-*l*93.2%
distribute-lft-out96.9%
fma-def96.9%
+-commutative96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in y around 0 88.9%
if -4.5e21 < a < 1.15e-104Initial program 99.1%
associate-+l+99.1%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in t around inf 88.7%
Final simplification88.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.65e+174) (+ x (+ (* (* z a) b) (* t a))) (if (<= b 6e-98) (+ (* t a) (+ x (* y z))) (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.65e+174) {
tmp = x + (((z * a) * b) + (t * a));
} else if (b <= 6e-98) {
tmp = (t * a) + (x + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3.65d+174)) then
tmp = x + (((z * a) * b) + (t * a))
else if (b <= 6d-98) then
tmp = (t * a) + (x + (y * z))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.65e+174) {
tmp = x + (((z * a) * b) + (t * a));
} else if (b <= 6e-98) {
tmp = (t * a) + (x + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.65e+174: tmp = x + (((z * a) * b) + (t * a)) elif b <= 6e-98: tmp = (t * a) + (x + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.65e+174) tmp = Float64(x + Float64(Float64(Float64(z * a) * b) + Float64(t * a))); elseif (b <= 6e-98) tmp = Float64(Float64(t * a) + Float64(x + Float64(y * z))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -3.65e+174) tmp = x + (((z * a) * b) + (t * a)); elseif (b <= 6e-98) tmp = (t * a) + (x + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.65e+174], N[(x + N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-98], N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.65 \cdot 10^{+174}:\\
\;\;\;\;x + \left(\left(z \cdot a\right) \cdot b + t \cdot a\right)\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-98}:\\
\;\;\;\;t \cdot a + \left(x + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -3.6500000000000002e174Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
*-commutative97.3%
associate-*l*75.2%
distribute-lft-out75.2%
fma-def75.2%
+-commutative75.2%
fma-def75.2%
Simplified75.2%
Taylor expanded in y around 0 74.1%
distribute-lft-in74.1%
*-commutative74.1%
*-commutative74.1%
associate-*l*93.8%
Applied egg-rr93.8%
if -3.6500000000000002e174 < b < 6e-98Initial program 95.1%
associate-+l+95.1%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in t around inf 90.8%
if 6e-98 < b Initial program 92.0%
associate-+l+92.0%
+-commutative92.0%
*-commutative92.0%
associate-*l*89.3%
distribute-lft-out93.3%
fma-def93.3%
+-commutative93.3%
fma-def93.3%
Simplified93.3%
Taylor expanded in y around 0 86.2%
Final simplification89.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5200000.0) x (if (<= x -1.95e-306) (* t a) (if (<= x 5.2e+35) (* y z) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5200000.0) {
tmp = x;
} else if (x <= -1.95e-306) {
tmp = t * a;
} else if (x <= 5.2e+35) {
tmp = y * z;
} 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 <= (-5200000.0d0)) then
tmp = x
else if (x <= (-1.95d-306)) then
tmp = t * a
else if (x <= 5.2d+35) then
tmp = y * z
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 <= -5200000.0) {
tmp = x;
} else if (x <= -1.95e-306) {
tmp = t * a;
} else if (x <= 5.2e+35) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5200000.0: tmp = x elif x <= -1.95e-306: tmp = t * a elif x <= 5.2e+35: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5200000.0) tmp = x; elseif (x <= -1.95e-306) tmp = Float64(t * a); elseif (x <= 5.2e+35) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5200000.0) tmp = x; elseif (x <= -1.95e-306) tmp = t * a; elseif (x <= 5.2e+35) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5200000.0], x, If[LessEqual[x, -1.95e-306], N[(t * a), $MachinePrecision], If[LessEqual[x, 5.2e+35], N[(y * z), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5200000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-306}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+35}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.2e6 or 5.20000000000000013e35 < x Initial program 94.6%
associate-+l+94.6%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in x around inf 53.1%
if -5.2e6 < x < -1.95e-306Initial program 93.5%
associate-+l+93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in t around inf 66.6%
Taylor expanded in a around inf 41.8%
if -1.95e-306 < x < 5.20000000000000013e35Initial program 95.4%
associate-+l+95.4%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in y around inf 41.6%
*-commutative41.6%
Simplified41.6%
Final simplification47.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7e+97) (not (<= z 8.2e+80))) (* z (* a b)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7e+97) || !(z <= 8.2e+80)) {
tmp = z * (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 <= (-7d+97)) .or. (.not. (z <= 8.2d+80))) then
tmp = z * (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 <= -7e+97) || !(z <= 8.2e+80)) {
tmp = z * (a * b);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7e+97) or not (z <= 8.2e+80): tmp = z * (a * b) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7e+97) || !(z <= 8.2e+80)) tmp = Float64(z * 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 <= -7e+97) || ~((z <= 8.2e+80))) tmp = z * (a * b); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7e+97], N[Not[LessEqual[z, 8.2e+80]], $MachinePrecision]], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+97} \lor \neg \left(z \leq 8.2 \cdot 10^{+80}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -7.0000000000000001e97 or 8.20000000000000003e80 < z Initial program 84.2%
associate-+l+84.2%
associate-*l*75.4%
Simplified75.4%
Taylor expanded in z around inf 84.8%
Taylor expanded in a around inf 51.5%
if -7.0000000000000001e97 < z < 8.20000000000000003e80Initial program 99.9%
associate-+l+99.9%
associate-*l*99.4%
Simplified99.4%
Taylor expanded in z around 0 72.4%
Final simplification65.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.2e+42) (not (<= y 98.0))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.2e+42) || !(y <= 98.0)) {
tmp = x + (y * z);
} 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 ((y <= (-5.2d+42)) .or. (.not. (y <= 98.0d0))) then
tmp = x + (y * z)
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 ((y <= -5.2e+42) || !(y <= 98.0)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5.2e+42) or not (y <= 98.0): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.2e+42) || !(y <= 98.0)) tmp = Float64(x + Float64(y * z)); 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 ((y <= -5.2e+42) || ~((y <= 98.0))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.2e+42], N[Not[LessEqual[y, 98.0]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+42} \lor \neg \left(y \leq 98\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -5.1999999999999998e42 or 98 < y Initial program 92.4%
associate-+l+92.4%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in a around 0 68.5%
if -5.1999999999999998e42 < y < 98Initial program 96.4%
associate-+l+96.4%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in z around 0 64.0%
Final simplification66.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -122000000.0) x (if (<= x 1.4e+39) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -122000000.0) {
tmp = x;
} else if (x <= 1.4e+39) {
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 <= (-122000000.0d0)) then
tmp = x
else if (x <= 1.4d+39) 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 <= -122000000.0) {
tmp = x;
} else if (x <= 1.4e+39) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -122000000.0: tmp = x elif x <= 1.4e+39: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -122000000.0) tmp = x; elseif (x <= 1.4e+39) 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 <= -122000000.0) tmp = x; elseif (x <= 1.4e+39) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -122000000.0], x, If[LessEqual[x, 1.4e+39], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -122000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+39}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.22e8 or 1.40000000000000001e39 < x Initial program 94.5%
associate-+l+94.5%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in x around inf 53.9%
if -1.22e8 < x < 1.40000000000000001e39Initial program 94.6%
associate-+l+94.6%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in t around inf 71.5%
Taylor expanded in a around inf 34.9%
Final simplification44.3%
(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.5%
associate-+l+94.5%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in x around inf 31.2%
Final simplification31.2%
(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 2023196
(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)))