
(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 16 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 (fma t (/ z 16.0) (fma x y (- c (* b (/ a 4.0))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(t, (z / 16.0), fma(x, y, (c - (b * (a / 4.0)))));
}
function code(x, y, z, t, a, b, c) return fma(t, Float64(z / 16.0), fma(x, y, Float64(c - Float64(b * Float64(a / 4.0))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(t * N[(z / 16.0), $MachinePrecision] + N[(x * y + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Initial program 97.3%
associate-+l-97.3%
+-commutative97.3%
associate--l+97.3%
associate-*l/97.7%
*-commutative97.7%
fma-def98.4%
fma-neg99.2%
neg-sub099.2%
associate-+l-99.2%
neg-sub099.2%
+-commutative99.2%
unsub-neg99.2%
*-commutative99.2%
associate-*r/99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (* t (/ z 16.0))) (- c (* b (/ a 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (t * (z / 16.0))) + (c - (b * (a / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(t * Float64(z / 16.0))) + Float64(c - Float64(b * Float64(a / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(t * N[(z / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, t \cdot \frac{z}{16}\right) + \left(c - b \cdot \frac{a}{4}\right)
\end{array}
Initial program 97.3%
associate-+l-97.3%
fma-def97.7%
associate-*l/98.0%
associate-*l/98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z)))
(t_2 (+ c t_1))
(t_3 (+ c (* x y)))
(t_4 (+ t_1 (* (* b a) -0.25))))
(if (<= y -4.8e-15)
t_3
(if (<= y -3.4e-227)
t_2
(if (<= y 4.8e-223)
t_4
(if (<= y 2.45e-197)
t_2
(if (<= y 1.2e-30)
t_4
(if (<= y 1.25e+81)
t_2
(if (<= y 8.4e+105)
(+ c (* b (* a -0.25)))
(if (<= y 5.4e+163) t_3 (- (* x y) (* (* b a) 0.25))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double t_2 = c + t_1;
double t_3 = c + (x * y);
double t_4 = t_1 + ((b * a) * -0.25);
double tmp;
if (y <= -4.8e-15) {
tmp = t_3;
} else if (y <= -3.4e-227) {
tmp = t_2;
} else if (y <= 4.8e-223) {
tmp = t_4;
} else if (y <= 2.45e-197) {
tmp = t_2;
} else if (y <= 1.2e-30) {
tmp = t_4;
} else if (y <= 1.25e+81) {
tmp = t_2;
} else if (y <= 8.4e+105) {
tmp = c + (b * (a * -0.25));
} else if (y <= 5.4e+163) {
tmp = t_3;
} else {
tmp = (x * y) - ((b * a) * 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
t_2 = c + t_1
t_3 = c + (x * y)
t_4 = t_1 + ((b * a) * (-0.25d0))
if (y <= (-4.8d-15)) then
tmp = t_3
else if (y <= (-3.4d-227)) then
tmp = t_2
else if (y <= 4.8d-223) then
tmp = t_4
else if (y <= 2.45d-197) then
tmp = t_2
else if (y <= 1.2d-30) then
tmp = t_4
else if (y <= 1.25d+81) then
tmp = t_2
else if (y <= 8.4d+105) then
tmp = c + (b * (a * (-0.25d0)))
else if (y <= 5.4d+163) then
tmp = t_3
else
tmp = (x * y) - ((b * a) * 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 * (t * z);
double t_2 = c + t_1;
double t_3 = c + (x * y);
double t_4 = t_1 + ((b * a) * -0.25);
double tmp;
if (y <= -4.8e-15) {
tmp = t_3;
} else if (y <= -3.4e-227) {
tmp = t_2;
} else if (y <= 4.8e-223) {
tmp = t_4;
} else if (y <= 2.45e-197) {
tmp = t_2;
} else if (y <= 1.2e-30) {
tmp = t_4;
} else if (y <= 1.25e+81) {
tmp = t_2;
} else if (y <= 8.4e+105) {
tmp = c + (b * (a * -0.25));
} else if (y <= 5.4e+163) {
tmp = t_3;
} else {
tmp = (x * y) - ((b * a) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) t_2 = c + t_1 t_3 = c + (x * y) t_4 = t_1 + ((b * a) * -0.25) tmp = 0 if y <= -4.8e-15: tmp = t_3 elif y <= -3.4e-227: tmp = t_2 elif y <= 4.8e-223: tmp = t_4 elif y <= 2.45e-197: tmp = t_2 elif y <= 1.2e-30: tmp = t_4 elif y <= 1.25e+81: tmp = t_2 elif y <= 8.4e+105: tmp = c + (b * (a * -0.25)) elif y <= 5.4e+163: tmp = t_3 else: tmp = (x * y) - ((b * a) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) t_2 = Float64(c + t_1) t_3 = Float64(c + Float64(x * y)) t_4 = Float64(t_1 + Float64(Float64(b * a) * -0.25)) tmp = 0.0 if (y <= -4.8e-15) tmp = t_3; elseif (y <= -3.4e-227) tmp = t_2; elseif (y <= 4.8e-223) tmp = t_4; elseif (y <= 2.45e-197) tmp = t_2; elseif (y <= 1.2e-30) tmp = t_4; elseif (y <= 1.25e+81) tmp = t_2; elseif (y <= 8.4e+105) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (y <= 5.4e+163) tmp = t_3; else tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); t_2 = c + t_1; t_3 = c + (x * y); t_4 = t_1 + ((b * a) * -0.25); tmp = 0.0; if (y <= -4.8e-15) tmp = t_3; elseif (y <= -3.4e-227) tmp = t_2; elseif (y <= 4.8e-223) tmp = t_4; elseif (y <= 2.45e-197) tmp = t_2; elseif (y <= 1.2e-30) tmp = t_4; elseif (y <= 1.25e+81) tmp = t_2; elseif (y <= 8.4e+105) tmp = c + (b * (a * -0.25)); elseif (y <= 5.4e+163) tmp = t_3; else tmp = (x * y) - ((b * a) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-15], t$95$3, If[LessEqual[y, -3.4e-227], t$95$2, If[LessEqual[y, 4.8e-223], t$95$4, If[LessEqual[y, 2.45e-197], t$95$2, If[LessEqual[y, 1.2e-30], t$95$4, If[LessEqual[y, 1.25e+81], t$95$2, If[LessEqual[y, 8.4e+105], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+163], t$95$3, N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
t_2 := c + t_1\\
t_3 := c + x \cdot y\\
t_4 := t_1 + \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-15}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-227}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-223}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-197}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-30}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+163}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\end{array}
\end{array}
if y < -4.7999999999999999e-15 or 8.4000000000000004e105 < y < 5.39999999999999998e163Initial program 94.7%
Taylor expanded in x around inf 64.1%
if -4.7999999999999999e-15 < y < -3.39999999999999979e-227 or 4.79999999999999971e-223 < y < 2.4500000000000001e-197 or 1.19999999999999992e-30 < y < 1.25e81Initial program 100.0%
Taylor expanded in z around inf 60.7%
if -3.39999999999999979e-227 < y < 4.79999999999999971e-223 or 2.4500000000000001e-197 < y < 1.19999999999999992e-30Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 95.5%
cancel-sign-sub-inv95.5%
+-commutative95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.5%
fma-udef95.5%
metadata-eval95.5%
associate-*r*95.5%
*-commutative95.5%
*-commutative95.5%
+-commutative95.5%
fma-def95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in c around 0 69.9%
if 1.25e81 < y < 8.4000000000000004e105Initial program 66.7%
Taylor expanded in a around inf 34.9%
associate-*r*34.9%
*-commutative34.9%
*-commutative34.9%
Simplified34.9%
if 5.39999999999999998e163 < y Initial program 95.7%
associate-+l-95.7%
fma-def100.0%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around 0 70.0%
Taylor expanded in c around 0 65.7%
Final simplification64.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* t z)))) (t_2 (- (* x y) (* (* b a) 0.25))))
(if (<= (* b a) -1e+62)
t_2
(if (<= (* b a) -2e-270)
t_1
(if (<= (* b a) 5e-82)
(+ c (* x y))
(if (<= (* b a) 2e+132) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (t * z));
double t_2 = (x * y) - ((b * a) * 0.25);
double tmp;
if ((b * a) <= -1e+62) {
tmp = t_2;
} else if ((b * a) <= -2e-270) {
tmp = t_1;
} else if ((b * a) <= 5e-82) {
tmp = c + (x * y);
} else if ((b * a) <= 2e+132) {
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 + (0.0625d0 * (t * z))
t_2 = (x * y) - ((b * a) * 0.25d0)
if ((b * a) <= (-1d+62)) then
tmp = t_2
else if ((b * a) <= (-2d-270)) then
tmp = t_1
else if ((b * a) <= 5d-82) then
tmp = c + (x * y)
else if ((b * a) <= 2d+132) 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 + (0.0625 * (t * z));
double t_2 = (x * y) - ((b * a) * 0.25);
double tmp;
if ((b * a) <= -1e+62) {
tmp = t_2;
} else if ((b * a) <= -2e-270) {
tmp = t_1;
} else if ((b * a) <= 5e-82) {
tmp = c + (x * y);
} else if ((b * a) <= 2e+132) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (t * z)) t_2 = (x * y) - ((b * a) * 0.25) tmp = 0 if (b * a) <= -1e+62: tmp = t_2 elif (b * a) <= -2e-270: tmp = t_1 elif (b * a) <= 5e-82: tmp = c + (x * y) elif (b * a) <= 2e+132: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(t * z))) t_2 = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)) tmp = 0.0 if (Float64(b * a) <= -1e+62) tmp = t_2; elseif (Float64(b * a) <= -2e-270) tmp = t_1; elseif (Float64(b * a) <= 5e-82) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 2e+132) 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 + (0.0625 * (t * z)); t_2 = (x * y) - ((b * a) * 0.25); tmp = 0.0; if ((b * a) <= -1e+62) tmp = t_2; elseif ((b * a) <= -2e-270) tmp = t_1; elseif ((b * a) <= 5e-82) tmp = c + (x * y); elseif ((b * a) <= 2e+132) 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[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1e+62], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -2e-270], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 5e-82], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+132], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(t \cdot z\right)\\
t_2 := x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-270}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-82}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+132}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e62 or 1.99999999999999998e132 < (*.f64 a b) Initial program 94.0%
associate-+l-94.0%
fma-def94.0%
associate-*l/95.0%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in z around 0 86.6%
Taylor expanded in c around 0 79.7%
if -1.00000000000000004e62 < (*.f64 a b) < -2.0000000000000001e-270 or 4.9999999999999998e-82 < (*.f64 a b) < 1.99999999999999998e132Initial program 99.1%
Taylor expanded in z around inf 68.6%
if -2.0000000000000001e-270 < (*.f64 a b) < 4.9999999999999998e-82Initial program 98.6%
Taylor expanded in x around inf 64.8%
Final simplification71.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)) (t_2 (* 0.0625 (* t z))))
(if (<= (* x y) -4e-20)
(- (+ c (* x y)) t_1)
(if (<= (* x y) 5e+131) (- (+ c t_2) t_1) (+ c (+ (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double t_2 = 0.0625 * (t * z);
double tmp;
if ((x * y) <= -4e-20) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 5e+131) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + 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 = (b * a) * 0.25d0
t_2 = 0.0625d0 * (t * z)
if ((x * y) <= (-4d-20)) then
tmp = (c + (x * y)) - t_1
else if ((x * y) <= 5d+131) then
tmp = (c + t_2) - t_1
else
tmp = c + ((x * y) + 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 = (b * a) * 0.25;
double t_2 = 0.0625 * (t * z);
double tmp;
if ((x * y) <= -4e-20) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 5e+131) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 t_2 = 0.0625 * (t * z) tmp = 0 if (x * y) <= -4e-20: tmp = (c + (x * y)) - t_1 elif (x * y) <= 5e+131: tmp = (c + t_2) - t_1 else: tmp = c + ((x * y) + t_2) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) t_2 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (Float64(x * y) <= -4e-20) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(x * y) <= 5e+131) tmp = Float64(Float64(c + t_2) - t_1); else tmp = Float64(c + Float64(Float64(x * y) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * 0.25; t_2 = 0.0625 * (t * z); tmp = 0.0; if ((x * y) <= -4e-20) tmp = (c + (x * y)) - t_1; elseif ((x * y) <= 5e+131) tmp = (c + t_2) - t_1; else tmp = c + ((x * y) + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e-20], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+131], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-20}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+131}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999978e-20Initial program 94.2%
associate-+l-94.2%
fma-def94.2%
associate-*l/94.2%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in z around 0 85.5%
if -3.99999999999999978e-20 < (*.f64 x y) < 4.99999999999999995e131Initial program 99.4%
associate-+l-99.4%
fma-def99.4%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around 0 95.4%
if 4.99999999999999995e131 < (*.f64 x y) Initial program 95.1%
Taylor expanded in a around 0 92.9%
Final simplification92.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))) (t_2 (* b (* a -0.25))))
(if (<= x -3e+193)
(* x y)
(if (<= x -1.15e+143)
t_1
(if (<= x -1.2e+96)
(* x y)
(if (<= x -7.8e-94)
t_2
(if (<= x -1.05e-121)
t_1
(if (<= x -2.7e-248) t_2 (if (<= x 5.5e+39) 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 * (t * z);
double t_2 = b * (a * -0.25);
double tmp;
if (x <= -3e+193) {
tmp = x * y;
} else if (x <= -1.15e+143) {
tmp = t_1;
} else if (x <= -1.2e+96) {
tmp = x * y;
} else if (x <= -7.8e-94) {
tmp = t_2;
} else if (x <= -1.05e-121) {
tmp = t_1;
} else if (x <= -2.7e-248) {
tmp = t_2;
} else if (x <= 5.5e+39) {
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) :: t_2
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
t_2 = b * (a * (-0.25d0))
if (x <= (-3d+193)) then
tmp = x * y
else if (x <= (-1.15d+143)) then
tmp = t_1
else if (x <= (-1.2d+96)) then
tmp = x * y
else if (x <= (-7.8d-94)) then
tmp = t_2
else if (x <= (-1.05d-121)) then
tmp = t_1
else if (x <= (-2.7d-248)) then
tmp = t_2
else if (x <= 5.5d+39) 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 * (t * z);
double t_2 = b * (a * -0.25);
double tmp;
if (x <= -3e+193) {
tmp = x * y;
} else if (x <= -1.15e+143) {
tmp = t_1;
} else if (x <= -1.2e+96) {
tmp = x * y;
} else if (x <= -7.8e-94) {
tmp = t_2;
} else if (x <= -1.05e-121) {
tmp = t_1;
} else if (x <= -2.7e-248) {
tmp = t_2;
} else if (x <= 5.5e+39) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) t_2 = b * (a * -0.25) tmp = 0 if x <= -3e+193: tmp = x * y elif x <= -1.15e+143: tmp = t_1 elif x <= -1.2e+96: tmp = x * y elif x <= -7.8e-94: tmp = t_2 elif x <= -1.05e-121: tmp = t_1 elif x <= -2.7e-248: tmp = t_2 elif x <= 5.5e+39: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) t_2 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (x <= -3e+193) tmp = Float64(x * y); elseif (x <= -1.15e+143) tmp = t_1; elseif (x <= -1.2e+96) tmp = Float64(x * y); elseif (x <= -7.8e-94) tmp = t_2; elseif (x <= -1.05e-121) tmp = t_1; elseif (x <= -2.7e-248) tmp = t_2; elseif (x <= 5.5e+39) 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 * (t * z); t_2 = b * (a * -0.25); tmp = 0.0; if (x <= -3e+193) tmp = x * y; elseif (x <= -1.15e+143) tmp = t_1; elseif (x <= -1.2e+96) tmp = x * y; elseif (x <= -7.8e-94) tmp = t_2; elseif (x <= -1.05e-121) tmp = t_1; elseif (x <= -2.7e-248) tmp = t_2; elseif (x <= 5.5e+39) 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[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+193], N[(x * y), $MachinePrecision], If[LessEqual[x, -1.15e+143], t$95$1, If[LessEqual[x, -1.2e+96], N[(x * y), $MachinePrecision], If[LessEqual[x, -7.8e-94], t$95$2, If[LessEqual[x, -1.05e-121], t$95$1, If[LessEqual[x, -2.7e-248], t$95$2, If[LessEqual[x, 5.5e+39], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \leq -3 \cdot 10^{+193}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+96}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{-94}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-248}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -3e193 or -1.15e143 < x < -1.19999999999999996e96 or 5.4999999999999997e39 < x Initial program 93.0%
associate-+l-93.0%
fma-def94.2%
associate-*l/94.2%
associate-*l/94.2%
Simplified94.2%
fma-udef93.0%
*-commutative93.0%
div-inv93.0%
metadata-eval93.0%
Applied egg-rr93.0%
Taylor expanded in x around inf 60.3%
if -3e193 < x < -1.15e143 or -7.8000000000000004e-94 < x < -1.0499999999999999e-121 or -2.7000000000000001e-248 < x < 5.4999999999999997e39Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 48.1%
if -1.19999999999999996e96 < x < -7.8000000000000004e-94 or -1.0499999999999999e-121 < x < -2.7000000000000001e-248Initial program 98.7%
associate-+l-98.7%
fma-def98.7%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 28.1%
*-commutative28.1%
*-commutative28.1%
associate-*r*28.1%
Simplified28.1%
Final simplification47.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* t z))))
(t_2 (+ c (* x y)))
(t_3 (+ c (* b (* a -0.25)))))
(if (<= y -9e-15)
t_2
(if (<= y -1.65e-244)
t_1
(if (<= y -5.6e-303)
t_3
(if (<= y 5.5e-241)
t_1
(if (<= y 1.65e-102) t_3 (if (<= y 1.55e+60) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (t * z));
double t_2 = c + (x * y);
double t_3 = c + (b * (a * -0.25));
double tmp;
if (y <= -9e-15) {
tmp = t_2;
} else if (y <= -1.65e-244) {
tmp = t_1;
} else if (y <= -5.6e-303) {
tmp = t_3;
} else if (y <= 5.5e-241) {
tmp = t_1;
} else if (y <= 1.65e-102) {
tmp = t_3;
} else if (y <= 1.55e+60) {
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) :: t_3
real(8) :: tmp
t_1 = c + (0.0625d0 * (t * z))
t_2 = c + (x * y)
t_3 = c + (b * (a * (-0.25d0)))
if (y <= (-9d-15)) then
tmp = t_2
else if (y <= (-1.65d-244)) then
tmp = t_1
else if (y <= (-5.6d-303)) then
tmp = t_3
else if (y <= 5.5d-241) then
tmp = t_1
else if (y <= 1.65d-102) then
tmp = t_3
else if (y <= 1.55d+60) 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 + (0.0625 * (t * z));
double t_2 = c + (x * y);
double t_3 = c + (b * (a * -0.25));
double tmp;
if (y <= -9e-15) {
tmp = t_2;
} else if (y <= -1.65e-244) {
tmp = t_1;
} else if (y <= -5.6e-303) {
tmp = t_3;
} else if (y <= 5.5e-241) {
tmp = t_1;
} else if (y <= 1.65e-102) {
tmp = t_3;
} else if (y <= 1.55e+60) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (t * z)) t_2 = c + (x * y) t_3 = c + (b * (a * -0.25)) tmp = 0 if y <= -9e-15: tmp = t_2 elif y <= -1.65e-244: tmp = t_1 elif y <= -5.6e-303: tmp = t_3 elif y <= 5.5e-241: tmp = t_1 elif y <= 1.65e-102: tmp = t_3 elif y <= 1.55e+60: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(t * z))) t_2 = Float64(c + Float64(x * y)) t_3 = Float64(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (y <= -9e-15) tmp = t_2; elseif (y <= -1.65e-244) tmp = t_1; elseif (y <= -5.6e-303) tmp = t_3; elseif (y <= 5.5e-241) tmp = t_1; elseif (y <= 1.65e-102) tmp = t_3; elseif (y <= 1.55e+60) 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 + (0.0625 * (t * z)); t_2 = c + (x * y); t_3 = c + (b * (a * -0.25)); tmp = 0.0; if (y <= -9e-15) tmp = t_2; elseif (y <= -1.65e-244) tmp = t_1; elseif (y <= -5.6e-303) tmp = t_3; elseif (y <= 5.5e-241) tmp = t_1; elseif (y <= 1.65e-102) tmp = t_3; elseif (y <= 1.55e+60) 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[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-15], t$95$2, If[LessEqual[y, -1.65e-244], t$95$1, If[LessEqual[y, -5.6e-303], t$95$3, If[LessEqual[y, 5.5e-241], t$95$1, If[LessEqual[y, 1.65e-102], t$95$3, If[LessEqual[y, 1.55e+60], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(t \cdot z\right)\\
t_2 := c + x \cdot y\\
t_3 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;y \leq -9 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-244}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-303}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-241}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-102}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -8.9999999999999995e-15 or 1.55e60 < y Initial program 94.5%
Taylor expanded in x around inf 63.4%
if -8.9999999999999995e-15 < y < -1.65000000000000013e-244 or -5.6e-303 < y < 5.4999999999999998e-241 or 1.65e-102 < y < 1.55e60Initial program 100.0%
Taylor expanded in z around inf 62.7%
if -1.65000000000000013e-244 < y < -5.6e-303 or 5.4999999999999998e-241 < y < 1.65e-102Initial program 100.0%
Taylor expanded in a around inf 62.5%
associate-*r*62.5%
*-commutative62.5%
*-commutative62.5%
Simplified62.5%
Final simplification63.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5e+14) (not (<= (* b a) 2e+132))) (- (+ c (* x y)) (* (* b a) 0.25)) (+ c (+ (* x y) (* 0.0625 (* t z))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+14) || !((b * a) <= 2e+132)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (t * z)));
}
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 (((b * a) <= (-5d+14)) .or. (.not. ((b * a) <= 2d+132))) then
tmp = (c + (x * y)) - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (t * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+14) || !((b * a) <= 2e+132)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (t * z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -5e+14) or not ((b * a) <= 2e+132): tmp = (c + (x * y)) - ((b * a) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (t * z))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -5e+14) || !(Float64(b * a) <= 2e+132)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(t * z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -5e+14) || ~(((b * a) <= 2e+132))) tmp = (c + (x * y)) - ((b * a) * 0.25); else tmp = c + ((x * y) + (0.0625 * (t * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+14], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+132]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+14} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+132}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e14 or 1.99999999999999998e132 < (*.f64 a b) Initial program 95.0%
associate-+l-95.0%
fma-def95.0%
associate-*l/95.9%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 85.4%
if -5e14 < (*.f64 a b) < 1.99999999999999998e132Initial program 98.7%
Taylor expanded in a around 0 95.1%
Final simplification91.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= (* b a) -1.1e+62)
(- (* x y) (* (* b a) 0.25))
(if (<= (* b a) 2e+141)
(+ c (+ (* x y) t_1))
(+ t_1 (* (* b a) -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if ((b * a) <= -1.1e+62) {
tmp = (x * y) - ((b * a) * 0.25);
} else if ((b * a) <= 2e+141) {
tmp = c + ((x * y) + t_1);
} else {
tmp = t_1 + ((b * a) * -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 * (t * z)
if ((b * a) <= (-1.1d+62)) then
tmp = (x * y) - ((b * a) * 0.25d0)
else if ((b * a) <= 2d+141) then
tmp = c + ((x * y) + t_1)
else
tmp = t_1 + ((b * a) * (-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 * (t * z);
double tmp;
if ((b * a) <= -1.1e+62) {
tmp = (x * y) - ((b * a) * 0.25);
} else if ((b * a) <= 2e+141) {
tmp = c + ((x * y) + t_1);
} else {
tmp = t_1 + ((b * a) * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if (b * a) <= -1.1e+62: tmp = (x * y) - ((b * a) * 0.25) elif (b * a) <= 2e+141: tmp = c + ((x * y) + t_1) else: tmp = t_1 + ((b * a) * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (Float64(b * a) <= -1.1e+62) tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)); elseif (Float64(b * a) <= 2e+141) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(t_1 + Float64(Float64(b * a) * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); tmp = 0.0; if ((b * a) <= -1.1e+62) tmp = (x * y) - ((b * a) * 0.25); elseif ((b * a) <= 2e+141) tmp = c + ((x * y) + t_1); else tmp = t_1 + ((b * a) * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1.1e+62], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+141], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;b \cdot a \leq -1.1 \cdot 10^{+62}:\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+141}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(b \cdot a\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -1.10000000000000007e62Initial program 91.4%
associate-+l-91.4%
fma-def91.4%
associate-*l/92.9%
associate-*l/92.9%
Simplified92.9%
Taylor expanded in z around 0 85.9%
Taylor expanded in c around 0 79.4%
if -1.10000000000000007e62 < (*.f64 a b) < 2.00000000000000003e141Initial program 98.9%
Taylor expanded in a around 0 93.4%
if 2.00000000000000003e141 < (*.f64 a b) Initial program 99.9%
associate-+l-99.9%
fma-def99.9%
associate-*l/99.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in x around 0 95.8%
cancel-sign-sub-inv95.8%
+-commutative95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*95.8%
fma-udef95.8%
metadata-eval95.8%
associate-*r*95.8%
*-commutative95.8%
*-commutative95.8%
+-commutative95.8%
fma-def95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in c around 0 86.6%
Final simplification89.8%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
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 + ((((t * z) / 16.0d0) + (x * y)) - ((b * a) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 97.3%
Final simplification97.3%
(FPCore (x y z t a b c) :precision binary64 (+ (+ (* t (* z 0.0625)) (* x y)) (- c (* b (/ a 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((t * (z * 0.0625)) + (x * y)) + (c - (b * (a / 4.0)));
}
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 = ((t * (z * 0.0625d0)) + (x * y)) + (c - (b * (a / 4.0d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((t * (z * 0.0625)) + (x * y)) + (c - (b * (a / 4.0)));
}
def code(x, y, z, t, a, b, c): return ((t * (z * 0.0625)) + (x * y)) + (c - (b * (a / 4.0)))
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(t * Float64(z * 0.0625)) + Float64(x * y)) + Float64(c - Float64(b * Float64(a / 4.0)))) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((t * (z * 0.0625)) + (x * y)) + (c - (b * (a / 4.0))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(t \cdot \left(z \cdot 0.0625\right) + x \cdot y\right) + \left(c - b \cdot \frac{a}{4}\right)
\end{array}
Initial program 97.3%
associate-+l-97.3%
fma-def97.7%
associate-*l/98.0%
associate-*l/98.0%
Simplified98.0%
fma-udef97.7%
*-commutative97.7%
div-inv97.7%
metadata-eval97.7%
Applied egg-rr97.7%
Final simplification97.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* t z))) (t_3 (+ c t_2)))
(if (<= t -5.5e-108)
t_3
(if (<= t 2.1e-30)
t_1
(if (<= t 7.1e-9) t_2 (if (<= t 6.6e+24) t_1 t_3))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = 0.0625 * (t * z);
double t_3 = c + t_2;
double tmp;
if (t <= -5.5e-108) {
tmp = t_3;
} else if (t <= 2.1e-30) {
tmp = t_1;
} else if (t <= 7.1e-9) {
tmp = t_2;
} else if (t <= 6.6e+24) {
tmp = t_1;
} 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 + (x * y)
t_2 = 0.0625d0 * (t * z)
t_3 = c + t_2
if (t <= (-5.5d-108)) then
tmp = t_3
else if (t <= 2.1d-30) then
tmp = t_1
else if (t <= 7.1d-9) then
tmp = t_2
else if (t <= 6.6d+24) then
tmp = t_1
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 + (x * y);
double t_2 = 0.0625 * (t * z);
double t_3 = c + t_2;
double tmp;
if (t <= -5.5e-108) {
tmp = t_3;
} else if (t <= 2.1e-30) {
tmp = t_1;
} else if (t <= 7.1e-9) {
tmp = t_2;
} else if (t <= 6.6e+24) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = 0.0625 * (t * z) t_3 = c + t_2 tmp = 0 if t <= -5.5e-108: tmp = t_3 elif t <= 2.1e-30: tmp = t_1 elif t <= 7.1e-9: tmp = t_2 elif t <= 6.6e+24: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(0.0625 * Float64(t * z)) t_3 = Float64(c + t_2) tmp = 0.0 if (t <= -5.5e-108) tmp = t_3; elseif (t <= 2.1e-30) tmp = t_1; elseif (t <= 7.1e-9) tmp = t_2; elseif (t <= 6.6e+24) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = 0.0625 * (t * z); t_3 = c + t_2; tmp = 0.0; if (t <= -5.5e-108) tmp = t_3; elseif (t <= 2.1e-30) tmp = t_1; elseif (t <= 7.1e-9) tmp = t_2; elseif (t <= 6.6e+24) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + t$95$2), $MachinePrecision]}, If[LessEqual[t, -5.5e-108], t$95$3, If[LessEqual[t, 2.1e-30], t$95$1, If[LessEqual[t, 7.1e-9], t$95$2, If[LessEqual[t, 6.6e+24], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
t_3 := c + t_2\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-108}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.1 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -5.50000000000000031e-108 or 6.5999999999999998e24 < t Initial program 97.4%
Taylor expanded in z around inf 59.9%
if -5.50000000000000031e-108 < t < 2.1000000000000002e-30 or 7.09999999999999988e-9 < t < 6.5999999999999998e24Initial program 97.0%
Taylor expanded in x around inf 58.0%
if 2.1000000000000002e-30 < t < 7.09999999999999988e-9Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 22.5%
Final simplification58.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -1.45e+193)
(* x y)
(if (or (<= x -1.15e+143) (and (not (<= x -7.4e+82)) (<= x 2e+61)))
(* 0.0625 (* t z))
(* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.45e+193) {
tmp = x * y;
} else if ((x <= -1.15e+143) || (!(x <= -7.4e+82) && (x <= 2e+61))) {
tmp = 0.0625 * (t * z);
} 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) :: tmp
if (x <= (-1.45d+193)) then
tmp = x * y
else if ((x <= (-1.15d+143)) .or. (.not. (x <= (-7.4d+82))) .and. (x <= 2d+61)) then
tmp = 0.0625d0 * (t * z)
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 tmp;
if (x <= -1.45e+193) {
tmp = x * y;
} else if ((x <= -1.15e+143) || (!(x <= -7.4e+82) && (x <= 2e+61))) {
tmp = 0.0625 * (t * z);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -1.45e+193: tmp = x * y elif (x <= -1.15e+143) or (not (x <= -7.4e+82) and (x <= 2e+61)): tmp = 0.0625 * (t * z) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -1.45e+193) tmp = Float64(x * y); elseif ((x <= -1.15e+143) || (!(x <= -7.4e+82) && (x <= 2e+61))) tmp = Float64(0.0625 * Float64(t * z)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (x <= -1.45e+193) tmp = x * y; elseif ((x <= -1.15e+143) || (~((x <= -7.4e+82)) && (x <= 2e+61))) tmp = 0.0625 * (t * z); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -1.45e+193], N[(x * y), $MachinePrecision], If[Or[LessEqual[x, -1.15e+143], And[N[Not[LessEqual[x, -7.4e+82]], $MachinePrecision], LessEqual[x, 2e+61]]], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+193}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{+143} \lor \neg \left(x \leq -7.4 \cdot 10^{+82}\right) \land x \leq 2 \cdot 10^{+61}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -1.45000000000000007e193 or -1.15e143 < x < -7.4000000000000005e82 or 1.9999999999999999e61 < x Initial program 94.0%
associate-+l-94.0%
fma-def95.2%
associate-*l/95.2%
associate-*l/95.2%
Simplified95.2%
fma-udef94.0%
*-commutative94.0%
div-inv94.0%
metadata-eval94.0%
Applied egg-rr94.0%
Taylor expanded in x around inf 59.0%
if -1.45000000000000007e193 < x < -1.15e143 or -7.4000000000000005e82 < x < 1.9999999999999999e61Initial program 98.9%
associate-+l-98.9%
fma-def98.9%
associate-*l/99.4%
associate-*l/99.4%
Simplified99.4%
fma-udef99.4%
*-commutative99.4%
div-inv99.4%
metadata-eval99.4%
Applied egg-rr99.4%
Taylor expanded in t around inf 41.2%
Final simplification47.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* t z))))
(if (<= t -5.4e-105)
t_2
(if (<= t 2.1e-30)
t_1
(if (<= t 7.4e-9) t_2 (if (<= t 9.5e+115) t_1 (* t (* z 0.0625))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = 0.0625 * (t * z);
double tmp;
if (t <= -5.4e-105) {
tmp = t_2;
} else if (t <= 2.1e-30) {
tmp = t_1;
} else if (t <= 7.4e-9) {
tmp = t_2;
} else if (t <= 9.5e+115) {
tmp = t_1;
} else {
tmp = t * (z * 0.0625);
}
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 + (x * y)
t_2 = 0.0625d0 * (t * z)
if (t <= (-5.4d-105)) then
tmp = t_2
else if (t <= 2.1d-30) then
tmp = t_1
else if (t <= 7.4d-9) then
tmp = t_2
else if (t <= 9.5d+115) then
tmp = t_1
else
tmp = t * (z * 0.0625d0)
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 + (x * y);
double t_2 = 0.0625 * (t * z);
double tmp;
if (t <= -5.4e-105) {
tmp = t_2;
} else if (t <= 2.1e-30) {
tmp = t_1;
} else if (t <= 7.4e-9) {
tmp = t_2;
} else if (t <= 9.5e+115) {
tmp = t_1;
} else {
tmp = t * (z * 0.0625);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = 0.0625 * (t * z) tmp = 0 if t <= -5.4e-105: tmp = t_2 elif t <= 2.1e-30: tmp = t_1 elif t <= 7.4e-9: tmp = t_2 elif t <= 9.5e+115: tmp = t_1 else: tmp = t * (z * 0.0625) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (t <= -5.4e-105) tmp = t_2; elseif (t <= 2.1e-30) tmp = t_1; elseif (t <= 7.4e-9) tmp = t_2; elseif (t <= 9.5e+115) tmp = t_1; else tmp = Float64(t * Float64(z * 0.0625)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = 0.0625 * (t * z); tmp = 0.0; if (t <= -5.4e-105) tmp = t_2; elseif (t <= 2.1e-30) tmp = t_1; elseif (t <= 7.4e-9) tmp = t_2; elseif (t <= 9.5e+115) tmp = t_1; else tmp = t * (z * 0.0625); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.4e-105], t$95$2, If[LessEqual[t, 2.1e-30], t$95$1, If[LessEqual[t, 7.4e-9], t$95$2, If[LessEqual[t, 9.5e+115], t$95$1, N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{-105}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+115}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if t < -5.39999999999999985e-105 or 2.1000000000000002e-30 < t < 7.4e-9Initial program 99.0%
associate-+l-99.0%
fma-def100.0%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
fma-udef99.0%
*-commutative99.0%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in t around inf 43.7%
if -5.39999999999999985e-105 < t < 2.1000000000000002e-30 or 7.4e-9 < t < 9.4999999999999997e115Initial program 97.5%
Taylor expanded in x around inf 55.2%
if 9.4999999999999997e115 < t Initial program 90.8%
associate-+l-90.8%
fma-def90.8%
associate-*l/93.5%
associate-*l/93.5%
Simplified93.5%
Taylor expanded in x around 0 72.0%
cancel-sign-sub-inv72.0%
+-commutative72.0%
*-commutative72.0%
*-commutative72.0%
associate-*l*74.8%
fma-udef74.8%
metadata-eval74.8%
associate-*r*74.8%
*-commutative74.8%
*-commutative74.8%
+-commutative74.8%
fma-def74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in c around 0 65.5%
Taylor expanded in t around inf 52.8%
associate-*r*55.5%
*-commutative55.5%
associate-*r*55.5%
Simplified55.5%
Final simplification50.6%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -2.8e-25) (* x y) (if (<= y 9e+41) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -2.8e-25) {
tmp = x * y;
} else if (y <= 9e+41) {
tmp = c;
} 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) :: tmp
if (y <= (-2.8d-25)) then
tmp = x * y
else if (y <= 9d+41) then
tmp = c
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 tmp;
if (y <= -2.8e-25) {
tmp = x * y;
} else if (y <= 9e+41) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -2.8e-25: tmp = x * y elif y <= 9e+41: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -2.8e-25) tmp = Float64(x * y); elseif (y <= 9e+41) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -2.8e-25) tmp = x * y; elseif (y <= 9e+41) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -2.8e-25], N[(x * y), $MachinePrecision], If[LessEqual[y, 9e+41], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+41}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.79999999999999988e-25 or 9.0000000000000002e41 < y Initial program 94.7%
associate-+l-94.7%
fma-def95.4%
associate-*l/96.1%
associate-*l/96.1%
Simplified96.1%
fma-udef95.3%
*-commutative95.3%
div-inv95.3%
metadata-eval95.3%
Applied egg-rr95.3%
Taylor expanded in x around inf 48.9%
if -2.79999999999999988e-25 < y < 9.0000000000000002e41Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
associate-*l/100.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in c around inf 26.9%
Final simplification37.9%
(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 97.3%
associate-+l-97.3%
fma-def97.7%
associate-*l/98.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in c around inf 20.9%
Final simplification20.9%
herbie shell --seed 2023196
(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))