
(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 (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 98.0%
associate-+l-98.0%
+-commutative98.0%
associate--l+98.0%
associate-*l/98.0%
*-commutative98.0%
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
(let* ((t_1 (* (* b a) 0.25)) (t_2 (- (* 0.0625 (* t z)) t_1)))
(if (<= x -4.6e+52)
(- (* x y) t_1)
(if (<= x -2.2e-109)
(+ c (* t (* z 0.0625)))
(if (<= x 1.02e-292)
t_2
(if (<= x 8e-140)
(+ c (* (* b a) -0.25))
(if (<= x 8e-72) t_2 (+ c (* x y)))))))))
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)) - t_1;
double tmp;
if (x <= -4.6e+52) {
tmp = (x * y) - t_1;
} else if (x <= -2.2e-109) {
tmp = c + (t * (z * 0.0625));
} else if (x <= 1.02e-292) {
tmp = t_2;
} else if (x <= 8e-140) {
tmp = c + ((b * a) * -0.25);
} else if (x <= 8e-72) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * a) * 0.25d0
t_2 = (0.0625d0 * (t * z)) - t_1
if (x <= (-4.6d+52)) then
tmp = (x * y) - t_1
else if (x <= (-2.2d-109)) then
tmp = c + (t * (z * 0.0625d0))
else if (x <= 1.02d-292) then
tmp = t_2
else if (x <= 8d-140) then
tmp = c + ((b * a) * (-0.25d0))
else if (x <= 8d-72) then
tmp = t_2
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 t_1 = (b * a) * 0.25;
double t_2 = (0.0625 * (t * z)) - t_1;
double tmp;
if (x <= -4.6e+52) {
tmp = (x * y) - t_1;
} else if (x <= -2.2e-109) {
tmp = c + (t * (z * 0.0625));
} else if (x <= 1.02e-292) {
tmp = t_2;
} else if (x <= 8e-140) {
tmp = c + ((b * a) * -0.25);
} else if (x <= 8e-72) {
tmp = t_2;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 t_2 = (0.0625 * (t * z)) - t_1 tmp = 0 if x <= -4.6e+52: tmp = (x * y) - t_1 elif x <= -2.2e-109: tmp = c + (t * (z * 0.0625)) elif x <= 1.02e-292: tmp = t_2 elif x <= 8e-140: tmp = c + ((b * a) * -0.25) elif x <= 8e-72: tmp = t_2 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) t_2 = Float64(Float64(0.0625 * Float64(t * z)) - t_1) tmp = 0.0 if (x <= -4.6e+52) tmp = Float64(Float64(x * y) - t_1); elseif (x <= -2.2e-109) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (x <= 1.02e-292) tmp = t_2; elseif (x <= 8e-140) tmp = Float64(c + Float64(Float64(b * a) * -0.25)); elseif (x <= 8e-72) tmp = t_2; else tmp = Float64(c + Float64(x * y)); 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)) - t_1; tmp = 0.0; if (x <= -4.6e+52) tmp = (x * y) - t_1; elseif (x <= -2.2e-109) tmp = c + (t * (z * 0.0625)); elseif (x <= 1.02e-292) tmp = t_2; elseif (x <= 8e-140) tmp = c + ((b * a) * -0.25); elseif (x <= 8e-72) tmp = t_2; else tmp = c + (x * y); 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[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[x, -4.6e+52], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, -2.2e-109], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.02e-292], t$95$2, If[LessEqual[x, 8e-140], N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-72], t$95$2, N[(c + N[(x * y), $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) - t_1\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+52}:\\
\;\;\;\;x \cdot y - t_1\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-109}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-292}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-140}:\\
\;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-72}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if x < -4.6e52Initial program 97.7%
Taylor expanded in z around 0 82.2%
Taylor expanded in c around 0 70.7%
if -4.6e52 < x < -2.1999999999999999e-109Initial program 99.9%
Taylor expanded in z around inf 59.5%
*-commutative59.5%
associate-*r*59.5%
*-commutative59.5%
Simplified59.5%
if -2.1999999999999999e-109 < x < 1.0200000000000001e-292 or 7.9999999999999999e-140 < x < 7.9999999999999997e-72Initial program 100.0%
Taylor expanded in x around 0 89.4%
Taylor expanded in c around 0 74.1%
if 1.0200000000000001e-292 < x < 7.9999999999999999e-140Initial program 100.0%
Taylor expanded in a around inf 63.5%
*-commutative63.5%
Simplified63.5%
if 7.9999999999999997e-72 < x Initial program 95.7%
Taylor expanded in x around inf 58.8%
Final simplification64.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625))))
(t_2 (+ c (* x y)))
(t_3 (* b (* a -0.25))))
(if (<= x -29500000.0)
t_2
(if (<= x -4.6e-298)
t_1
(if (<= x 8e-308)
t_3
(if (<= x 6e-274)
t_1
(if (<= x 7e-256) t_3 (if (<= x 6.2e-72) 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 t_3 = b * (a * -0.25);
double tmp;
if (x <= -29500000.0) {
tmp = t_2;
} else if (x <= -4.6e-298) {
tmp = t_1;
} else if (x <= 8e-308) {
tmp = t_3;
} else if (x <= 6e-274) {
tmp = t_1;
} else if (x <= 7e-256) {
tmp = t_3;
} else if (x <= 6.2e-72) {
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 + (t * (z * 0.0625d0))
t_2 = c + (x * y)
t_3 = b * (a * (-0.25d0))
if (x <= (-29500000.0d0)) then
tmp = t_2
else if (x <= (-4.6d-298)) then
tmp = t_1
else if (x <= 8d-308) then
tmp = t_3
else if (x <= 6d-274) then
tmp = t_1
else if (x <= 7d-256) then
tmp = t_3
else if (x <= 6.2d-72) 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 t_3 = b * (a * -0.25);
double tmp;
if (x <= -29500000.0) {
tmp = t_2;
} else if (x <= -4.6e-298) {
tmp = t_1;
} else if (x <= 8e-308) {
tmp = t_3;
} else if (x <= 6e-274) {
tmp = t_1;
} else if (x <= 7e-256) {
tmp = t_3;
} else if (x <= 6.2e-72) {
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) t_3 = b * (a * -0.25) tmp = 0 if x <= -29500000.0: tmp = t_2 elif x <= -4.6e-298: tmp = t_1 elif x <= 8e-308: tmp = t_3 elif x <= 6e-274: tmp = t_1 elif x <= 7e-256: tmp = t_3 elif x <= 6.2e-72: 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)) t_3 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (x <= -29500000.0) tmp = t_2; elseif (x <= -4.6e-298) tmp = t_1; elseif (x <= 8e-308) tmp = t_3; elseif (x <= 6e-274) tmp = t_1; elseif (x <= 7e-256) tmp = t_3; elseif (x <= 6.2e-72) 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); t_3 = b * (a * -0.25); tmp = 0.0; if (x <= -29500000.0) tmp = t_2; elseif (x <= -4.6e-298) tmp = t_1; elseif (x <= 8e-308) tmp = t_3; elseif (x <= 6e-274) tmp = t_1; elseif (x <= 7e-256) tmp = t_3; elseif (x <= 6.2e-72) 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]}, Block[{t$95$3 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -29500000.0], t$95$2, If[LessEqual[x, -4.6e-298], t$95$1, If[LessEqual[x, 8e-308], t$95$3, If[LessEqual[x, 6e-274], t$95$1, If[LessEqual[x, 7e-256], t$95$3, If[LessEqual[x, 6.2e-72], 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\\
t_3 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \leq -29500000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-308}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-274}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-256}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.95e7 or 6.1999999999999996e-72 < x Initial program 96.5%
Taylor expanded in x around inf 61.4%
if -2.95e7 < x < -4.6000000000000001e-298 or 8.00000000000000026e-308 < x < 5.99999999999999954e-274 or 7.00000000000000028e-256 < x < 6.1999999999999996e-72Initial program 100.0%
Taylor expanded in z around inf 61.4%
*-commutative61.4%
associate-*r*61.4%
*-commutative61.4%
Simplified61.4%
if -4.6000000000000001e-298 < x < 8.00000000000000026e-308 or 5.99999999999999954e-274 < x < 7.00000000000000028e-256Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-/l*99.4%
Simplified99.4%
fma-udef99.4%
associate-/l*99.6%
+-commutative99.6%
associate-/l*99.4%
div-inv99.4%
clear-num99.6%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around inf 63.8%
*-commutative63.8%
*-commutative63.8%
associate-*l*63.8%
Simplified63.8%
Final simplification61.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* (* b a) -0.25))) (t_2 (+ c (* x y))))
(if (<= x -2.2e+88)
t_2
(if (<= x -3.7e+53)
t_1
(if (<= x -54000000000.0)
t_2
(if (<= x -2.9e-271)
(+ c (* t (* z 0.0625)))
(if (<= x 8.5e-92) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((b * a) * -0.25);
double t_2 = c + (x * y);
double tmp;
if (x <= -2.2e+88) {
tmp = t_2;
} else if (x <= -3.7e+53) {
tmp = t_1;
} else if (x <= -54000000000.0) {
tmp = t_2;
} else if (x <= -2.9e-271) {
tmp = c + (t * (z * 0.0625));
} else if (x <= 8.5e-92) {
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 + ((b * a) * (-0.25d0))
t_2 = c + (x * y)
if (x <= (-2.2d+88)) then
tmp = t_2
else if (x <= (-3.7d+53)) then
tmp = t_1
else if (x <= (-54000000000.0d0)) then
tmp = t_2
else if (x <= (-2.9d-271)) then
tmp = c + (t * (z * 0.0625d0))
else if (x <= 8.5d-92) 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 + ((b * a) * -0.25);
double t_2 = c + (x * y);
double tmp;
if (x <= -2.2e+88) {
tmp = t_2;
} else if (x <= -3.7e+53) {
tmp = t_1;
} else if (x <= -54000000000.0) {
tmp = t_2;
} else if (x <= -2.9e-271) {
tmp = c + (t * (z * 0.0625));
} else if (x <= 8.5e-92) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + ((b * a) * -0.25) t_2 = c + (x * y) tmp = 0 if x <= -2.2e+88: tmp = t_2 elif x <= -3.7e+53: tmp = t_1 elif x <= -54000000000.0: tmp = t_2 elif x <= -2.9e-271: tmp = c + (t * (z * 0.0625)) elif x <= 8.5e-92: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(Float64(b * a) * -0.25)) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (x <= -2.2e+88) tmp = t_2; elseif (x <= -3.7e+53) tmp = t_1; elseif (x <= -54000000000.0) tmp = t_2; elseif (x <= -2.9e-271) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (x <= 8.5e-92) 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 + ((b * a) * -0.25); t_2 = c + (x * y); tmp = 0.0; if (x <= -2.2e+88) tmp = t_2; elseif (x <= -3.7e+53) tmp = t_1; elseif (x <= -54000000000.0) tmp = t_2; elseif (x <= -2.9e-271) tmp = c + (t * (z * 0.0625)); elseif (x <= 8.5e-92) 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[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+88], t$95$2, If[LessEqual[x, -3.7e+53], t$95$1, If[LessEqual[x, -54000000000.0], t$95$2, If[LessEqual[x, -2.9e-271], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-92], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + \left(b \cdot a\right) \cdot -0.25\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+88}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -54000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-271}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.20000000000000009e88 or -3.7e53 < x < -5.4e10 or 8.50000000000000067e-92 < x Initial program 96.4%
Taylor expanded in x around inf 60.7%
if -2.20000000000000009e88 < x < -3.7e53 or -2.90000000000000014e-271 < x < 8.50000000000000067e-92Initial program 100.0%
Taylor expanded in a around inf 61.9%
*-commutative61.9%
Simplified61.9%
if -5.4e10 < x < -2.90000000000000014e-271Initial program 99.9%
Taylor expanded in z around inf 62.9%
*-commutative62.9%
associate-*r*62.9%
*-commutative62.9%
Simplified62.9%
Final simplification61.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)))
(if (or (<= x -4.6e+52) (not (<= x 3.6e-72)))
(- (+ c (* x y)) t_1)
(- (+ c (* 0.0625 (* t z))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double tmp;
if ((x <= -4.6e+52) || !(x <= 3.6e-72)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + (0.0625 * (t * z))) - 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 = (b * a) * 0.25d0
if ((x <= (-4.6d+52)) .or. (.not. (x <= 3.6d-72))) then
tmp = (c + (x * y)) - t_1
else
tmp = (c + (0.0625d0 * (t * z))) - 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 = (b * a) * 0.25;
double tmp;
if ((x <= -4.6e+52) || !(x <= 3.6e-72)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + (0.0625 * (t * z))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 tmp = 0 if (x <= -4.6e+52) or not (x <= 3.6e-72): tmp = (c + (x * y)) - t_1 else: tmp = (c + (0.0625 * (t * z))) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) tmp = 0.0 if ((x <= -4.6e+52) || !(x <= 3.6e-72)) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(c + Float64(0.0625 * Float64(t * z))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * 0.25; tmp = 0.0; if ((x <= -4.6e+52) || ~((x <= 3.6e-72))) tmp = (c + (x * y)) - t_1; else tmp = (c + (0.0625 * (t * z))) - t_1; 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]}, If[Or[LessEqual[x, -4.6e+52], N[Not[LessEqual[x, 3.6e-72]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+52} \lor \neg \left(x \leq 3.6 \cdot 10^{-72}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - t_1\\
\end{array}
\end{array}
if x < -4.6e52 or 3.6e-72 < x Initial program 96.4%
Taylor expanded in z around 0 79.1%
if -4.6e52 < x < 3.6e-72Initial program 100.0%
Taylor expanded in x around 0 91.4%
Final simplification84.7%
(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 98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)))
(if (<= z -6e+197)
(+ c (* t (* z 0.0625)))
(if (<= z 1.5e-8) (- (+ c (* x y)) t_1) (- (* 0.0625 (* t z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double tmp;
if (z <= -6e+197) {
tmp = c + (t * (z * 0.0625));
} else if (z <= 1.5e-8) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (0.0625 * (t * z)) - 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 = (b * a) * 0.25d0
if (z <= (-6d+197)) then
tmp = c + (t * (z * 0.0625d0))
else if (z <= 1.5d-8) then
tmp = (c + (x * y)) - t_1
else
tmp = (0.0625d0 * (t * z)) - 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 = (b * a) * 0.25;
double tmp;
if (z <= -6e+197) {
tmp = c + (t * (z * 0.0625));
} else if (z <= 1.5e-8) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (0.0625 * (t * z)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 tmp = 0 if z <= -6e+197: tmp = c + (t * (z * 0.0625)) elif z <= 1.5e-8: tmp = (c + (x * y)) - t_1 else: tmp = (0.0625 * (t * z)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) tmp = 0.0 if (z <= -6e+197) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (z <= 1.5e-8) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(0.0625 * Float64(t * z)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * 0.25; tmp = 0.0; if (z <= -6e+197) tmp = c + (t * (z * 0.0625)); elseif (z <= 1.5e-8) tmp = (c + (x * y)) - t_1; else tmp = (0.0625 * (t * z)) - t_1; 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]}, If[LessEqual[z, -6e+197], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-8], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;z \leq -6 \cdot 10^{+197}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right) - t_1\\
\end{array}
\end{array}
if z < -6.0000000000000004e197Initial program 90.0%
Taylor expanded in z around inf 76.5%
*-commutative76.5%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
if -6.0000000000000004e197 < z < 1.49999999999999987e-8Initial program 98.2%
Taylor expanded in z around 0 81.6%
if 1.49999999999999987e-8 < z Initial program 100.0%
Taylor expanded in x around 0 79.9%
Taylor expanded in c around 0 67.4%
Final simplification77.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* b (* a -0.25))))
(if (<= b -4.2e-51)
t_2
(if (<= b 1.1e+126)
t_1
(if (<= b 8.5e+156)
(* 0.0625 (* t z))
(if (<= b 1.42e+197) t_1 t_2))))))
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 = b * (a * -0.25);
double tmp;
if (b <= -4.2e-51) {
tmp = t_2;
} else if (b <= 1.1e+126) {
tmp = t_1;
} else if (b <= 8.5e+156) {
tmp = 0.0625 * (t * z);
} else if (b <= 1.42e+197) {
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 + (x * y)
t_2 = b * (a * (-0.25d0))
if (b <= (-4.2d-51)) then
tmp = t_2
else if (b <= 1.1d+126) then
tmp = t_1
else if (b <= 8.5d+156) then
tmp = 0.0625d0 * (t * z)
else if (b <= 1.42d+197) 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 + (x * y);
double t_2 = b * (a * -0.25);
double tmp;
if (b <= -4.2e-51) {
tmp = t_2;
} else if (b <= 1.1e+126) {
tmp = t_1;
} else if (b <= 8.5e+156) {
tmp = 0.0625 * (t * z);
} else if (b <= 1.42e+197) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = b * (a * -0.25) tmp = 0 if b <= -4.2e-51: tmp = t_2 elif b <= 1.1e+126: tmp = t_1 elif b <= 8.5e+156: tmp = 0.0625 * (t * z) elif b <= 1.42e+197: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (b <= -4.2e-51) tmp = t_2; elseif (b <= 1.1e+126) tmp = t_1; elseif (b <= 8.5e+156) tmp = Float64(0.0625 * Float64(t * z)); elseif (b <= 1.42e+197) 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 + (x * y); t_2 = b * (a * -0.25); tmp = 0.0; if (b <= -4.2e-51) tmp = t_2; elseif (b <= 1.1e+126) tmp = t_1; elseif (b <= 8.5e+156) tmp = 0.0625 * (t * z); elseif (b <= 1.42e+197) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.2e-51], t$95$2, If[LessEqual[b, 1.1e+126], t$95$1, If[LessEqual[b, 8.5e+156], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.42e+197], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \leq -4.2 \cdot 10^{-51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{+156}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;b \leq 1.42 \cdot 10^{+197}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -4.20000000000000003e-51 or 1.42000000000000006e197 < b Initial program 96.8%
associate-+l-96.8%
sub-neg96.8%
neg-mul-196.8%
metadata-eval96.8%
metadata-eval96.8%
cancel-sign-sub-inv96.8%
fma-def96.8%
associate-/l*96.8%
metadata-eval96.8%
*-lft-identity96.8%
associate-/l*96.7%
Simplified96.7%
fma-udef96.7%
associate-/l*96.7%
+-commutative96.7%
associate-/l*96.7%
div-inv96.7%
clear-num96.7%
div-inv96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in a around inf 45.8%
*-commutative45.8%
*-commutative45.8%
associate-*l*45.8%
Simplified45.8%
if -4.20000000000000003e-51 < b < 1.09999999999999999e126 or 8.49999999999999948e156 < b < 1.42000000000000006e197Initial program 98.7%
Taylor expanded in x around inf 59.9%
if 1.09999999999999999e126 < b < 8.49999999999999948e156Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*100.0%
metadata-eval100.0%
*-lft-identity100.0%
associate-/l*100.0%
Simplified100.0%
fma-udef100.0%
associate-/l*100.0%
+-commutative100.0%
associate-/l*100.0%
div-inv100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 39.2%
Final simplification54.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -4.6e+52)
(- (* x y) (* (* b a) 0.25))
(if (<= x -9e-273)
(+ c (* t (* z 0.0625)))
(if (<= x 8.5e-92) (+ c (* (* b a) -0.25)) (+ c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -4.6e+52) {
tmp = (x * y) - ((b * a) * 0.25);
} else if (x <= -9e-273) {
tmp = c + (t * (z * 0.0625));
} else if (x <= 8.5e-92) {
tmp = c + ((b * a) * -0.25);
} 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 (x <= (-4.6d+52)) then
tmp = (x * y) - ((b * a) * 0.25d0)
else if (x <= (-9d-273)) then
tmp = c + (t * (z * 0.0625d0))
else if (x <= 8.5d-92) then
tmp = c + ((b * a) * (-0.25d0))
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 (x <= -4.6e+52) {
tmp = (x * y) - ((b * a) * 0.25);
} else if (x <= -9e-273) {
tmp = c + (t * (z * 0.0625));
} else if (x <= 8.5e-92) {
tmp = c + ((b * a) * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -4.6e+52: tmp = (x * y) - ((b * a) * 0.25) elif x <= -9e-273: tmp = c + (t * (z * 0.0625)) elif x <= 8.5e-92: tmp = c + ((b * a) * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -4.6e+52) tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)); elseif (x <= -9e-273) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (x <= 8.5e-92) tmp = Float64(c + Float64(Float64(b * a) * -0.25)); 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 (x <= -4.6e+52) tmp = (x * y) - ((b * a) * 0.25); elseif (x <= -9e-273) tmp = c + (t * (z * 0.0625)); elseif (x <= 8.5e-92) tmp = c + ((b * a) * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -4.6e+52], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9e-273], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-92], N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+52}:\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-273}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-92}:\\
\;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if x < -4.6e52Initial program 97.7%
Taylor expanded in z around 0 82.2%
Taylor expanded in c around 0 70.7%
if -4.6e52 < x < -8.99999999999999921e-273Initial program 99.9%
Taylor expanded in z around inf 59.9%
*-commutative59.9%
associate-*r*59.9%
*-commutative59.9%
Simplified59.9%
if -8.99999999999999921e-273 < x < 8.50000000000000067e-92Initial program 100.0%
Taylor expanded in a around inf 62.5%
*-commutative62.5%
Simplified62.5%
if 8.50000000000000067e-92 < x Initial program 95.9%
Taylor expanded in x around inf 57.8%
Final simplification61.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= y -64000.0)
(* x y)
(if (<= y 2.9e-282)
(* b (* a -0.25))
(if (<= y 2.1e+98) (* 0.0625 (* t z)) (if (<= y 1.1e+156) c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -64000.0) {
tmp = x * y;
} else if (y <= 2.9e-282) {
tmp = b * (a * -0.25);
} else if (y <= 2.1e+98) {
tmp = 0.0625 * (t * z);
} else if (y <= 1.1e+156) {
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 <= (-64000.0d0)) then
tmp = x * y
else if (y <= 2.9d-282) then
tmp = b * (a * (-0.25d0))
else if (y <= 2.1d+98) then
tmp = 0.0625d0 * (t * z)
else if (y <= 1.1d+156) 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 <= -64000.0) {
tmp = x * y;
} else if (y <= 2.9e-282) {
tmp = b * (a * -0.25);
} else if (y <= 2.1e+98) {
tmp = 0.0625 * (t * z);
} else if (y <= 1.1e+156) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -64000.0: tmp = x * y elif y <= 2.9e-282: tmp = b * (a * -0.25) elif y <= 2.1e+98: tmp = 0.0625 * (t * z) elif y <= 1.1e+156: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -64000.0) tmp = Float64(x * y); elseif (y <= 2.9e-282) tmp = Float64(b * Float64(a * -0.25)); elseif (y <= 2.1e+98) tmp = Float64(0.0625 * Float64(t * z)); elseif (y <= 1.1e+156) 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 <= -64000.0) tmp = x * y; elseif (y <= 2.9e-282) tmp = b * (a * -0.25); elseif (y <= 2.1e+98) tmp = 0.0625 * (t * z); elseif (y <= 1.1e+156) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -64000.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 2.9e-282], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+98], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+156], c, N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -64000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-282}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+98}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+156}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -64000 or 1.10000000000000002e156 < y Initial program 94.8%
associate-+l-94.8%
sub-neg94.8%
neg-mul-194.8%
metadata-eval94.8%
metadata-eval94.8%
cancel-sign-sub-inv94.8%
fma-def94.8%
associate-/l*94.8%
metadata-eval94.8%
*-lft-identity94.8%
associate-/l*94.7%
Simplified94.7%
fma-udef94.7%
associate-/l*94.7%
+-commutative94.7%
associate-/l*94.7%
div-inv94.7%
clear-num94.7%
div-inv94.7%
metadata-eval94.7%
Applied egg-rr94.7%
Taylor expanded in x around inf 56.6%
if -64000 < y < 2.89999999999999998e-282Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-/l*99.7%
Simplified99.7%
fma-udef99.7%
associate-/l*99.9%
+-commutative99.9%
associate-/l*99.7%
div-inv99.9%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 33.9%
*-commutative33.9%
*-commutative33.9%
associate-*l*33.9%
Simplified33.9%
if 2.89999999999999998e-282 < y < 2.10000000000000004e98Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*100.0%
metadata-eval100.0%
*-lft-identity100.0%
associate-/l*99.9%
Simplified99.9%
fma-udef99.9%
associate-/l*99.9%
+-commutative99.9%
associate-/l*99.9%
div-inv99.9%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 31.5%
if 2.10000000000000004e98 < y < 1.10000000000000002e156Initial program 100.0%
Taylor expanded in c around inf 51.0%
Final simplification42.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -1.45e-85) (* x y) (if (<= y 4.3e+97) (* 0.0625 (* t z)) (if (<= y 6.5e+155) c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -1.45e-85) {
tmp = x * y;
} else if (y <= 4.3e+97) {
tmp = 0.0625 * (t * z);
} else if (y <= 6.5e+155) {
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 <= (-1.45d-85)) then
tmp = x * y
else if (y <= 4.3d+97) then
tmp = 0.0625d0 * (t * z)
else if (y <= 6.5d+155) 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 <= -1.45e-85) {
tmp = x * y;
} else if (y <= 4.3e+97) {
tmp = 0.0625 * (t * z);
} else if (y <= 6.5e+155) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -1.45e-85: tmp = x * y elif y <= 4.3e+97: tmp = 0.0625 * (t * z) elif y <= 6.5e+155: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -1.45e-85) tmp = Float64(x * y); elseif (y <= 4.3e+97) tmp = Float64(0.0625 * Float64(t * z)); elseif (y <= 6.5e+155) 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 <= -1.45e-85) tmp = x * y; elseif (y <= 4.3e+97) tmp = 0.0625 * (t * z); elseif (y <= 6.5e+155) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -1.45e-85], N[(x * y), $MachinePrecision], If[LessEqual[y, 4.3e+97], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+155], c, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-85}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{+97}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+155}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.4500000000000001e-85 or 6.50000000000000046e155 < y Initial program 95.6%
associate-+l-95.6%
sub-neg95.6%
neg-mul-195.6%
metadata-eval95.6%
metadata-eval95.6%
cancel-sign-sub-inv95.6%
fma-def95.6%
associate-/l*95.5%
metadata-eval95.5%
*-lft-identity95.5%
associate-/l*95.5%
Simplified95.5%
fma-udef95.5%
associate-/l*95.5%
+-commutative95.5%
associate-/l*95.5%
div-inv95.5%
clear-num95.5%
div-inv95.5%
metadata-eval95.5%
Applied egg-rr95.5%
Taylor expanded in x around inf 48.6%
if -1.4500000000000001e-85 < y < 4.2999999999999998e97Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.9%
metadata-eval99.9%
*-lft-identity99.9%
associate-/l*99.9%
Simplified99.9%
fma-udef99.9%
associate-/l*99.9%
+-commutative99.9%
associate-/l*99.9%
div-inv99.9%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 35.1%
if 4.2999999999999998e97 < y < 6.50000000000000046e155Initial program 100.0%
Taylor expanded in c around inf 51.0%
Final simplification41.5%
(FPCore (x y z t a b c) :precision binary64 (if (<= x -1.3e+113) (* x y) (if (<= x 2.7e-39) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.3e+113) {
tmp = x * y;
} else if (x <= 2.7e-39) {
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 (x <= (-1.3d+113)) then
tmp = x * y
else if (x <= 2.7d-39) 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 (x <= -1.3e+113) {
tmp = x * y;
} else if (x <= 2.7e-39) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -1.3e+113: tmp = x * y elif x <= 2.7e-39: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -1.3e+113) tmp = Float64(x * y); elseif (x <= 2.7e-39) 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 (x <= -1.3e+113) tmp = x * y; elseif (x <= 2.7e-39) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -1.3e+113], N[(x * y), $MachinePrecision], If[LessEqual[x, 2.7e-39], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+113}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-39}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -1.3e113 or 2.7000000000000001e-39 < x Initial program 95.9%
associate-+l-95.9%
sub-neg95.9%
neg-mul-195.9%
metadata-eval95.9%
metadata-eval95.9%
cancel-sign-sub-inv95.9%
fma-def95.9%
associate-/l*95.9%
metadata-eval95.9%
*-lft-identity95.9%
associate-/l*95.8%
Simplified95.8%
fma-udef95.8%
associate-/l*95.9%
+-commutative95.9%
associate-/l*95.8%
div-inv95.9%
clear-num95.9%
div-inv95.9%
metadata-eval95.9%
Applied egg-rr95.9%
Taylor expanded in x around inf 49.1%
if -1.3e113 < x < 2.7000000000000001e-39Initial program 100.0%
Taylor expanded in c around inf 28.1%
Final simplification38.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 98.0%
Taylor expanded in c around inf 21.1%
Final simplification21.1%
herbie shell --seed 2023227
(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))