
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around inf 50.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
associate--l+96.9%
fma-def97.3%
associate-*l/97.3%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*98.0%
distribute-frac-neg98.0%
associate-/r/98.0%
fma-def98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*98.0%
metadata-eval98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -6e-5)
(* x y)
(if (<= (* x y) -4e-323)
t_1
(if (<= (* x y) 3.5e-196)
c
(if (<= (* x y) 2e-186)
t_1
(if (<= (* x y) 3.55e-62)
(* a (* b -0.25))
(if (<= (* x y) 2.15e+89) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -6e-5) {
tmp = x * y;
} else if ((x * y) <= -4e-323) {
tmp = t_1;
} else if ((x * y) <= 3.5e-196) {
tmp = c;
} else if ((x * y) <= 2e-186) {
tmp = t_1;
} else if ((x * y) <= 3.55e-62) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 2.15e+89) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((x * y) <= (-6d-5)) then
tmp = x * y
else if ((x * y) <= (-4d-323)) then
tmp = t_1
else if ((x * y) <= 3.5d-196) then
tmp = c
else if ((x * y) <= 2d-186) then
tmp = t_1
else if ((x * y) <= 3.55d-62) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 2.15d+89) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -6e-5) {
tmp = x * y;
} else if ((x * y) <= -4e-323) {
tmp = t_1;
} else if ((x * y) <= 3.5e-196) {
tmp = c;
} else if ((x * y) <= 2e-186) {
tmp = t_1;
} else if ((x * y) <= 3.55e-62) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 2.15e+89) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -6e-5: tmp = x * y elif (x * y) <= -4e-323: tmp = t_1 elif (x * y) <= 3.5e-196: tmp = c elif (x * y) <= 2e-186: tmp = t_1 elif (x * y) <= 3.55e-62: tmp = a * (b * -0.25) elif (x * y) <= 2.15e+89: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -6e-5) tmp = Float64(x * y); elseif (Float64(x * y) <= -4e-323) tmp = t_1; elseif (Float64(x * y) <= 3.5e-196) tmp = c; elseif (Float64(x * y) <= 2e-186) tmp = t_1; elseif (Float64(x * y) <= 3.55e-62) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 2.15e+89) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -6e-5) tmp = x * y; elseif ((x * y) <= -4e-323) tmp = t_1; elseif ((x * y) <= 3.5e-196) tmp = c; elseif ((x * y) <= 2e-186) tmp = t_1; elseif ((x * y) <= 3.55e-62) tmp = a * (b * -0.25); elseif ((x * y) <= 2.15e+89) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6e-5], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-323], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e-196], c, If[LessEqual[N[(x * y), $MachinePrecision], 2e-186], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.55e-62], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.15e+89], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -6 \cdot 10^{-5}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-323}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-196}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-186}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.55 \cdot 10^{-62}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 2.15 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -6.00000000000000015e-5 or 2.1500000000000001e89 < (*.f64 x y) Initial program 95.3%
associate-+l-95.3%
associate--l+95.3%
fma-def96.3%
associate-*l/96.3%
fma-neg96.3%
sub-neg96.3%
distribute-neg-in96.3%
remove-double-neg96.3%
associate-/l*96.3%
distribute-frac-neg96.3%
associate-/r/96.3%
fma-def96.3%
neg-mul-196.3%
*-commutative96.3%
associate-/l*96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in a around 0 87.0%
associate-*r*87.0%
*-commutative87.0%
associate-*r*87.0%
Simplified87.0%
Taylor expanded in x around inf 63.0%
if -6.00000000000000015e-5 < (*.f64 x y) < -3.95253e-323 or 3.50000000000000004e-196 < (*.f64 x y) < 1.9999999999999998e-186 or 3.5500000000000001e-62 < (*.f64 x y) < 2.1500000000000001e89Initial program 97.5%
associate-+l-97.5%
associate--l+97.5%
fma-def97.5%
associate-*l/97.5%
fma-neg98.8%
sub-neg98.8%
distribute-neg-in98.8%
remove-double-neg98.8%
associate-/l*98.7%
distribute-frac-neg98.7%
associate-/r/98.8%
fma-def98.8%
neg-mul-198.8%
*-commutative98.8%
associate-/l*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in a around 0 73.5%
associate-*r*73.5%
*-commutative73.5%
associate-*r*73.5%
Simplified73.5%
Taylor expanded in t around inf 43.1%
if -3.95253e-323 < (*.f64 x y) < 3.50000000000000004e-196Initial program 97.7%
Taylor expanded in c around inf 41.2%
if 1.9999999999999998e-186 < (*.f64 x y) < 3.5500000000000001e-62Initial program 100.0%
Taylor expanded in x around 0 92.3%
Taylor expanded in a around inf 73.2%
*-commutative73.2%
associate-*l*73.2%
Simplified73.2%
Final simplification54.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625))))
(t_2 (+ c (* (* a b) -0.25)))
(t_3 (+ c (* x y))))
(if (<= (* x y) -0.000145)
t_3
(if (<= (* x y) -1.2e-252)
t_1
(if (<= (* x y) 2.65e-62)
t_2
(if (<= (* x y) 9e+38) t_1 (if (<= (* x y) 2.8e+62) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + ((a * b) * -0.25);
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -0.000145) {
tmp = t_3;
} else if ((x * y) <= -1.2e-252) {
tmp = t_1;
} else if ((x * y) <= 2.65e-62) {
tmp = t_2;
} else if ((x * y) <= 9e+38) {
tmp = t_1;
} else if ((x * y) <= 2.8e+62) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = c + ((a * b) * (-0.25d0))
t_3 = c + (x * y)
if ((x * y) <= (-0.000145d0)) then
tmp = t_3
else if ((x * y) <= (-1.2d-252)) then
tmp = t_1
else if ((x * y) <= 2.65d-62) then
tmp = t_2
else if ((x * y) <= 9d+38) then
tmp = t_1
else if ((x * y) <= 2.8d+62) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + ((a * b) * -0.25);
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -0.000145) {
tmp = t_3;
} else if ((x * y) <= -1.2e-252) {
tmp = t_1;
} else if ((x * y) <= 2.65e-62) {
tmp = t_2;
} else if ((x * y) <= 9e+38) {
tmp = t_1;
} else if ((x * y) <= 2.8e+62) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + ((a * b) * -0.25) t_3 = c + (x * y) tmp = 0 if (x * y) <= -0.000145: tmp = t_3 elif (x * y) <= -1.2e-252: tmp = t_1 elif (x * y) <= 2.65e-62: tmp = t_2 elif (x * y) <= 9e+38: tmp = t_1 elif (x * y) <= 2.8e+62: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(Float64(a * b) * -0.25)) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -0.000145) tmp = t_3; elseif (Float64(x * y) <= -1.2e-252) tmp = t_1; elseif (Float64(x * y) <= 2.65e-62) tmp = t_2; elseif (Float64(x * y) <= 9e+38) tmp = t_1; elseif (Float64(x * y) <= 2.8e+62) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); t_2 = c + ((a * b) * -0.25); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -0.000145) tmp = t_3; elseif ((x * y) <= -1.2e-252) tmp = t_1; elseif ((x * y) <= 2.65e-62) tmp = t_2; elseif ((x * y) <= 9e+38) tmp = t_1; elseif ((x * y) <= 2.8e+62) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -0.000145], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1.2e-252], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.65e-62], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9e+38], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+62], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + \left(a \cdot b\right) \cdot -0.25\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -0.000145:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -1.2 \cdot 10^{-252}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2.65 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.45e-4 or 2.80000000000000014e62 < (*.f64 x y) Initial program 95.5%
Taylor expanded in x around inf 74.6%
if -1.45e-4 < (*.f64 x y) < -1.2000000000000001e-252 or 2.6499999999999998e-62 < (*.f64 x y) < 8.99999999999999961e38Initial program 96.8%
Taylor expanded in z around inf 69.1%
associate-*r*69.1%
*-commutative69.1%
associate-*r*69.1%
Simplified69.1%
if -1.2000000000000001e-252 < (*.f64 x y) < 2.6499999999999998e-62 or 8.99999999999999961e38 < (*.f64 x y) < 2.80000000000000014e62Initial program 98.8%
Taylor expanded in a around inf 72.3%
*-commutative72.3%
Simplified72.3%
Final simplification72.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* (* a b) -0.25))))
(if (<= (* a b) -2e+89)
t_1
(if (<= (* a b) 5e-224)
(+ c (* x y))
(if (<= (* a b) 2e-151)
(+ c (* t (* z 0.0625)))
(if (<= (* a b) 5e+108) (+ (* x y) (* 0.0625 (* z t))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((a * b) * -0.25);
double tmp;
if ((a * b) <= -2e+89) {
tmp = t_1;
} else if ((a * b) <= 5e-224) {
tmp = c + (x * y);
} else if ((a * b) <= 2e-151) {
tmp = c + (t * (z * 0.0625));
} else if ((a * b) <= 5e+108) {
tmp = (x * y) + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + ((a * b) * (-0.25d0))
if ((a * b) <= (-2d+89)) then
tmp = t_1
else if ((a * b) <= 5d-224) then
tmp = c + (x * y)
else if ((a * b) <= 2d-151) then
tmp = c + (t * (z * 0.0625d0))
else if ((a * b) <= 5d+108) then
tmp = (x * y) + (0.0625d0 * (z * t))
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 c) {
double t_1 = c + ((a * b) * -0.25);
double tmp;
if ((a * b) <= -2e+89) {
tmp = t_1;
} else if ((a * b) <= 5e-224) {
tmp = c + (x * y);
} else if ((a * b) <= 2e-151) {
tmp = c + (t * (z * 0.0625));
} else if ((a * b) <= 5e+108) {
tmp = (x * y) + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + ((a * b) * -0.25) tmp = 0 if (a * b) <= -2e+89: tmp = t_1 elif (a * b) <= 5e-224: tmp = c + (x * y) elif (a * b) <= 2e-151: tmp = c + (t * (z * 0.0625)) elif (a * b) <= 5e+108: tmp = (x * y) + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(Float64(a * b) * -0.25)) tmp = 0.0 if (Float64(a * b) <= -2e+89) tmp = t_1; elseif (Float64(a * b) <= 5e-224) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e-151) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(a * b) <= 5e+108) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + ((a * b) * -0.25); tmp = 0.0; if ((a * b) <= -2e+89) tmp = t_1; elseif ((a * b) <= 5e-224) tmp = c + (x * y); elseif ((a * b) <= 2e-151) tmp = c + (t * (z * 0.0625)); elseif ((a * b) <= 5e+108) tmp = (x * y) + (0.0625 * (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+89], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e-224], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e-151], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+108], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-224}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-151}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+108}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999999e89 or 4.99999999999999991e108 < (*.f64 a b) Initial program 94.1%
Taylor expanded in a around inf 74.3%
*-commutative74.3%
Simplified74.3%
if -1.99999999999999999e89 < (*.f64 a b) < 4.9999999999999999e-224Initial program 98.1%
Taylor expanded in x around inf 70.9%
if 4.9999999999999999e-224 < (*.f64 a b) < 1.9999999999999999e-151Initial program 91.7%
Taylor expanded in z around inf 91.7%
associate-*r*91.7%
*-commutative91.7%
associate-*r*91.7%
Simplified91.7%
if 1.9999999999999999e-151 < (*.f64 a b) < 4.99999999999999991e108Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around 0 88.8%
associate-*r*88.8%
*-commutative88.8%
associate-*r*88.8%
Simplified88.8%
Taylor expanded in c around 0 70.0%
Final simplification72.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -0.0053)
t_2
(if (<= (* x y) 4.2e-186)
t_1
(if (<= (* x y) 6.1e-62)
(* a (* b -0.25))
(if (<= (* x y) 3.8e+89) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -0.0053) {
tmp = t_2;
} else if ((x * y) <= 4.2e-186) {
tmp = t_1;
} else if ((x * y) <= 6.1e-62) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 3.8e+89) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = c + (x * y)
if ((x * y) <= (-0.0053d0)) then
tmp = t_2
else if ((x * y) <= 4.2d-186) then
tmp = t_1
else if ((x * y) <= 6.1d-62) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 3.8d+89) 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 c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -0.0053) {
tmp = t_2;
} else if ((x * y) <= 4.2e-186) {
tmp = t_1;
} else if ((x * y) <= 6.1e-62) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 3.8e+89) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -0.0053: tmp = t_2 elif (x * y) <= 4.2e-186: tmp = t_1 elif (x * y) <= 6.1e-62: tmp = a * (b * -0.25) elif (x * y) <= 3.8e+89: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -0.0053) tmp = t_2; elseif (Float64(x * y) <= 4.2e-186) tmp = t_1; elseif (Float64(x * y) <= 6.1e-62) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 3.8e+89) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -0.0053) tmp = t_2; elseif ((x * y) <= 4.2e-186) tmp = t_1; elseif ((x * y) <= 6.1e-62) tmp = a * (b * -0.25); elseif ((x * y) <= 3.8e+89) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -0.0053], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4.2e-186], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.1e-62], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.8e+89], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -0.0053:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 4.2 \cdot 10^{-186}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 6.1 \cdot 10^{-62}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -0.00530000000000000002 or 3.80000000000000023e89 < (*.f64 x y) Initial program 95.3%
Taylor expanded in x around inf 75.5%
if -0.00530000000000000002 < (*.f64 x y) < 4.2000000000000004e-186 or 6.1e-62 < (*.f64 x y) < 3.80000000000000023e89Initial program 97.6%
Taylor expanded in z around inf 66.9%
associate-*r*66.9%
*-commutative66.9%
associate-*r*66.9%
Simplified66.9%
if 4.2000000000000004e-186 < (*.f64 x y) < 6.1e-62Initial program 100.0%
Taylor expanded in x around 0 92.3%
Taylor expanded in a around inf 73.2%
*-commutative73.2%
associate-*l*73.2%
Simplified73.2%
Final simplification71.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -0.00058)
(* x y)
(if (<= (* x y) -4e-323)
t_1
(if (<= (* x y) 3.6e-196) c (if (<= (* x y) 2.1e+88) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -0.00058) {
tmp = x * y;
} else if ((x * y) <= -4e-323) {
tmp = t_1;
} else if ((x * y) <= 3.6e-196) {
tmp = c;
} else if ((x * y) <= 2.1e+88) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((x * y) <= (-0.00058d0)) then
tmp = x * y
else if ((x * y) <= (-4d-323)) then
tmp = t_1
else if ((x * y) <= 3.6d-196) then
tmp = c
else if ((x * y) <= 2.1d+88) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -0.00058) {
tmp = x * y;
} else if ((x * y) <= -4e-323) {
tmp = t_1;
} else if ((x * y) <= 3.6e-196) {
tmp = c;
} else if ((x * y) <= 2.1e+88) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -0.00058: tmp = x * y elif (x * y) <= -4e-323: tmp = t_1 elif (x * y) <= 3.6e-196: tmp = c elif (x * y) <= 2.1e+88: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -0.00058) tmp = Float64(x * y); elseif (Float64(x * y) <= -4e-323) tmp = t_1; elseif (Float64(x * y) <= 3.6e-196) tmp = c; elseif (Float64(x * y) <= 2.1e+88) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -0.00058) tmp = x * y; elseif ((x * y) <= -4e-323) tmp = t_1; elseif ((x * y) <= 3.6e-196) tmp = c; elseif ((x * y) <= 2.1e+88) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -0.00058], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-323], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.6e-196], c, If[LessEqual[N[(x * y), $MachinePrecision], 2.1e+88], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -0.00058:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-323}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{-196}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -5.8e-4 or 2.1e88 < (*.f64 x y) Initial program 95.3%
associate-+l-95.3%
associate--l+95.3%
fma-def96.3%
associate-*l/96.3%
fma-neg96.3%
sub-neg96.3%
distribute-neg-in96.3%
remove-double-neg96.3%
associate-/l*96.3%
distribute-frac-neg96.3%
associate-/r/96.3%
fma-def96.3%
neg-mul-196.3%
*-commutative96.3%
associate-/l*96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in a around 0 87.0%
associate-*r*87.0%
*-commutative87.0%
associate-*r*87.0%
Simplified87.0%
Taylor expanded in x around inf 63.0%
if -5.8e-4 < (*.f64 x y) < -3.95253e-323 or 3.6000000000000001e-196 < (*.f64 x y) < 2.1e88Initial program 98.1%
associate-+l-98.1%
associate--l+98.1%
fma-def98.1%
associate-*l/98.1%
fma-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
associate-/l*98.9%
distribute-frac-neg98.9%
associate-/r/99.0%
fma-def99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in a around 0 65.1%
associate-*r*65.1%
*-commutative65.1%
associate-*r*65.1%
Simplified65.1%
Taylor expanded in t around inf 39.1%
if -3.95253e-323 < (*.f64 x y) < 3.6000000000000001e-196Initial program 97.7%
Taylor expanded in c around inf 41.2%
Final simplification49.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* x y) -1.36e-5) (not (<= (* x y) 2.4e+61)))
(+ c (+ (* x y) t_1))
(- (+ c t_1) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -1.36e-5) || !((x * y) <= 2.4e+61)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((x * y) <= (-1.36d-5)) .or. (.not. ((x * y) <= 2.4d+61))) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + t_1) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -1.36e-5) || !((x * y) <= 2.4e+61)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((x * y) <= -1.36e-5) or not ((x * y) <= 2.4e+61): tmp = c + ((x * y) + t_1) else: tmp = (c + t_1) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(x * y) <= -1.36e-5) || !(Float64(x * y) <= 2.4e+61)) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((x * y) <= -1.36e-5) || ~(((x * y) <= 2.4e+61))) tmp = c + ((x * y) + t_1); else tmp = (c + t_1) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.36e-5], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.4e+61]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -1.36 \cdot 10^{-5} \lor \neg \left(x \cdot y \leq 2.4 \cdot 10^{+61}\right):\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -1.36000000000000002e-5 or 2.3999999999999999e61 < (*.f64 x y) Initial program 95.5%
Taylor expanded in a around 0 87.5%
if -1.36000000000000002e-5 < (*.f64 x y) < 2.3999999999999999e61Initial program 97.9%
Taylor expanded in x around 0 93.9%
Final simplification91.1%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+167)
(+ c (* (* a b) -0.25))
(if (<= (* a b) 5e+269)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+167) {
tmp = c + ((a * b) * -0.25);
} else if ((a * b) <= 5e+269) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-2d+167)) then
tmp = c + ((a * b) * (-0.25d0))
else if ((a * b) <= 5d+269) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = a * (b * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+167) {
tmp = c + ((a * b) * -0.25);
} else if ((a * b) <= 5e+269) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2e+167: tmp = c + ((a * b) * -0.25) elif (a * b) <= 5e+269: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = a * (b * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+167) tmp = Float64(c + Float64(Float64(a * b) * -0.25)); elseif (Float64(a * b) <= 5e+269) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(a * Float64(b * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -2e+167) tmp = c + ((a * b) * -0.25); elseif ((a * b) <= 5e+269) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = a * (b * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+167], N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+269], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+167}:\\
\;\;\;\;c + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+269}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e167Initial program 97.2%
Taylor expanded in a around inf 81.5%
*-commutative81.5%
Simplified81.5%
if -2.0000000000000001e167 < (*.f64 a b) < 5.0000000000000002e269Initial program 98.5%
Taylor expanded in a around 0 88.0%
if 5.0000000000000002e269 < (*.f64 a b) Initial program 78.9%
Taylor expanded in x around 0 78.9%
Taylor expanded in a around inf 89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
Final simplification87.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* a b) -2e+89)
(- t_1 (* (* a b) 0.25))
(if (<= (* a b) 5e+269) (+ c (+ (* x y) t_1)) (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -2e+89) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 5e+269) {
tmp = c + ((x * y) + t_1);
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((a * b) <= (-2d+89)) then
tmp = t_1 - ((a * b) * 0.25d0)
else if ((a * b) <= 5d+269) then
tmp = c + ((x * y) + t_1)
else
tmp = a * (b * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -2e+89) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 5e+269) {
tmp = c + ((x * y) + t_1);
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -2e+89: tmp = t_1 - ((a * b) * 0.25) elif (a * b) <= 5e+269: tmp = c + ((x * y) + t_1) else: tmp = a * (b * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -2e+89) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 5e+269) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(a * Float64(b * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -2e+89) tmp = t_1 - ((a * b) * 0.25); elseif ((a * b) <= 5e+269) tmp = c + ((x * y) + t_1); else tmp = a * (b * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+89], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+269], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+89}:\\
\;\;\;\;t_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+269}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999999e89Initial program 98.1%
Taylor expanded in x around 0 87.2%
Taylor expanded in c around 0 78.2%
if -1.99999999999999999e89 < (*.f64 a b) < 5.0000000000000002e269Initial program 98.4%
Taylor expanded in a around 0 89.6%
if 5.0000000000000002e269 < (*.f64 a b) Initial program 78.9%
Taylor expanded in x around 0 78.9%
Taylor expanded in a around inf 89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
Final simplification87.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -9.5e+158) (not (<= z 1.2e-31))) (* 0.0625 (* z t)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -9.5e+158) || !(z <= 1.2e-31)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((z <= (-9.5d+158)) .or. (.not. (z <= 1.2d-31))) then
tmp = 0.0625d0 * (z * t)
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -9.5e+158) || !(z <= 1.2e-31)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -9.5e+158) or not (z <= 1.2e-31): tmp = 0.0625 * (z * t) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -9.5e+158) || !(z <= 1.2e-31)) tmp = Float64(0.0625 * Float64(z * t)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -9.5e+158) || ~((z <= 1.2e-31))) tmp = 0.0625 * (z * t); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -9.5e+158], N[Not[LessEqual[z, 1.2e-31]], $MachinePrecision]], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+158} \lor \neg \left(z \leq 1.2 \cdot 10^{-31}\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if z < -9.49999999999999913e158 or 1.2e-31 < z Initial program 95.6%
associate-+l-95.6%
associate--l+95.6%
fma-def95.6%
associate-*l/95.6%
fma-neg97.8%
sub-neg97.8%
distribute-neg-in97.8%
remove-double-neg97.8%
associate-/l*97.8%
distribute-frac-neg97.8%
associate-/r/97.8%
fma-def97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
metadata-eval97.8%
Simplified97.8%
Taylor expanded in a around 0 77.2%
associate-*r*77.2%
*-commutative77.2%
associate-*r*77.2%
Simplified77.2%
Taylor expanded in t around inf 53.1%
if -9.49999999999999913e158 < z < 1.2e-31Initial program 97.6%
Taylor expanded in x around inf 62.7%
Final simplification59.3%
(FPCore (x y z t a b c) :precision binary64 (if (<= c -1.9e+122) c (if (<= c 7.6e+82) (* x y) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -1.9e+122) {
tmp = c;
} else if (c <= 7.6e+82) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (c <= (-1.9d+122)) then
tmp = c
else if (c <= 7.6d+82) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -1.9e+122) {
tmp = c;
} else if (c <= 7.6e+82) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if c <= -1.9e+122: tmp = c elif c <= 7.6e+82: tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -1.9e+122) tmp = c; elseif (c <= 7.6e+82) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (c <= -1.9e+122) tmp = c; elseif (c <= 7.6e+82) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -1.9e+122], c, If[LessEqual[c, 7.6e+82], N[(x * y), $MachinePrecision], c]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.9 \cdot 10^{+122}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{+82}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -1.8999999999999999e122 or 7.60000000000000067e82 < c Initial program 96.0%
Taylor expanded in c around inf 55.3%
if -1.8999999999999999e122 < c < 7.60000000000000067e82Initial program 97.2%
associate-+l-97.2%
associate--l+97.2%
fma-def97.2%
associate-*l/97.2%
fma-neg97.2%
sub-neg97.2%
distribute-neg-in97.2%
remove-double-neg97.2%
associate-/l*97.1%
distribute-frac-neg97.1%
associate-/r/97.2%
fma-def97.2%
neg-mul-197.2%
*-commutative97.2%
associate-/l*97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in a around 0 71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*r*71.9%
Simplified71.9%
Taylor expanded in x around inf 39.5%
Final simplification44.1%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in c around inf 21.1%
Final simplification21.1%
herbie shell --seed 2023271
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))