
(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 14 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 x y (fma b (* -0.25 a) (fma z (/ t 16.0) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(b, (-0.25 * a), fma(z, (t / 16.0), c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(b, Float64(-0.25 * a), fma(z, Float64(t / 16.0), c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(b * N[(-0.25 * a), $MachinePrecision] + N[(z * N[(t / 16.0), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(b, -0.25 \cdot a, \mathsf{fma}\left(z, \frac{t}{16}, c\right)\right)\right)
\end{array}
Initial program 96.5%
associate-+l-96.5%
+-commutative96.5%
associate--l+96.5%
+-commutative96.5%
associate-+l-96.5%
fma-neg98.0%
neg-sub098.0%
associate--l-98.0%
associate-+l-98.0%
neg-sub098.0%
*-commutative98.0%
associate-*r/98.0%
distribute-rgt-neg-in98.0%
fma-def98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
associate-/l*98.4%
associate-/r/98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(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 96.5%
associate-+l-96.5%
+-commutative96.5%
associate--l+96.5%
associate-*l/96.5%
*-commutative96.5%
fma-def97.7%
fma-neg98.4%
neg-sub098.4%
associate-+l-98.4%
neg-sub098.4%
+-commutative98.4%
unsub-neg98.4%
*-commutative98.4%
associate-*r/98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (/ z (/ 16.0 t))) (- c (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (z / (16.0 / t))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(z / Float64(16.0 / t))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 96.5%
associate-+l-96.5%
sub-neg96.5%
neg-mul-196.5%
metadata-eval96.5%
metadata-eval96.5%
cancel-sign-sub-inv96.5%
fma-def97.3%
associate-/l*97.2%
metadata-eval97.2%
*-lft-identity97.2%
associate-/l*97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* b a) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (* b (* -0.25 a)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = b * (-0.25 * a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = b * (-0.25 * a);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = b * (-0.25 * a) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(b * Float64(-0.25 * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = b * (-0.25 * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(b * N[(-0.25 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(-0.25 \cdot a\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in a around inf 55.9%
*-commutative55.9%
Simplified55.9%
Taylor expanded in a around inf 55.9%
associate-*r*55.9%
Simplified55.9%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))) (t_2 (* b (* -0.25 a))))
(if (<= b -2.95e-15)
t_2
(if (<= b -1.8e-114)
t_1
(if (<= b -4.5e-279)
(* x y)
(if (<= b 7e-247)
t_1
(if (<= b 4e-175)
c
(if (<= b 3e-125)
t_1
(if (<= b 1.2e-104)
c
(if (<= b 3.5e-33)
(* x y)
(if (<= b 2.95e+46)
c
(if (<= b 5.4e+174) (* x y) t_2))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double t_2 = b * (-0.25 * a);
double tmp;
if (b <= -2.95e-15) {
tmp = t_2;
} else if (b <= -1.8e-114) {
tmp = t_1;
} else if (b <= -4.5e-279) {
tmp = x * y;
} else if (b <= 7e-247) {
tmp = t_1;
} else if (b <= 4e-175) {
tmp = c;
} else if (b <= 3e-125) {
tmp = t_1;
} else if (b <= 1.2e-104) {
tmp = c;
} else if (b <= 3.5e-33) {
tmp = x * y;
} else if (b <= 2.95e+46) {
tmp = c;
} else if (b <= 5.4e+174) {
tmp = x * y;
} 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 = z * (t * 0.0625d0)
t_2 = b * ((-0.25d0) * a)
if (b <= (-2.95d-15)) then
tmp = t_2
else if (b <= (-1.8d-114)) then
tmp = t_1
else if (b <= (-4.5d-279)) then
tmp = x * y
else if (b <= 7d-247) then
tmp = t_1
else if (b <= 4d-175) then
tmp = c
else if (b <= 3d-125) then
tmp = t_1
else if (b <= 1.2d-104) then
tmp = c
else if (b <= 3.5d-33) then
tmp = x * y
else if (b <= 2.95d+46) then
tmp = c
else if (b <= 5.4d+174) then
tmp = x * y
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 = z * (t * 0.0625);
double t_2 = b * (-0.25 * a);
double tmp;
if (b <= -2.95e-15) {
tmp = t_2;
} else if (b <= -1.8e-114) {
tmp = t_1;
} else if (b <= -4.5e-279) {
tmp = x * y;
} else if (b <= 7e-247) {
tmp = t_1;
} else if (b <= 4e-175) {
tmp = c;
} else if (b <= 3e-125) {
tmp = t_1;
} else if (b <= 1.2e-104) {
tmp = c;
} else if (b <= 3.5e-33) {
tmp = x * y;
} else if (b <= 2.95e+46) {
tmp = c;
} else if (b <= 5.4e+174) {
tmp = x * y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) t_2 = b * (-0.25 * a) tmp = 0 if b <= -2.95e-15: tmp = t_2 elif b <= -1.8e-114: tmp = t_1 elif b <= -4.5e-279: tmp = x * y elif b <= 7e-247: tmp = t_1 elif b <= 4e-175: tmp = c elif b <= 3e-125: tmp = t_1 elif b <= 1.2e-104: tmp = c elif b <= 3.5e-33: tmp = x * y elif b <= 2.95e+46: tmp = c elif b <= 5.4e+174: tmp = x * y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) t_2 = Float64(b * Float64(-0.25 * a)) tmp = 0.0 if (b <= -2.95e-15) tmp = t_2; elseif (b <= -1.8e-114) tmp = t_1; elseif (b <= -4.5e-279) tmp = Float64(x * y); elseif (b <= 7e-247) tmp = t_1; elseif (b <= 4e-175) tmp = c; elseif (b <= 3e-125) tmp = t_1; elseif (b <= 1.2e-104) tmp = c; elseif (b <= 3.5e-33) tmp = Float64(x * y); elseif (b <= 2.95e+46) tmp = c; elseif (b <= 5.4e+174) tmp = Float64(x * y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = z * (t * 0.0625); t_2 = b * (-0.25 * a); tmp = 0.0; if (b <= -2.95e-15) tmp = t_2; elseif (b <= -1.8e-114) tmp = t_1; elseif (b <= -4.5e-279) tmp = x * y; elseif (b <= 7e-247) tmp = t_1; elseif (b <= 4e-175) tmp = c; elseif (b <= 3e-125) tmp = t_1; elseif (b <= 1.2e-104) tmp = c; elseif (b <= 3.5e-33) tmp = x * y; elseif (b <= 2.95e+46) tmp = c; elseif (b <= 5.4e+174) tmp = x * y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(-0.25 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.95e-15], t$95$2, If[LessEqual[b, -1.8e-114], t$95$1, If[LessEqual[b, -4.5e-279], N[(x * y), $MachinePrecision], If[LessEqual[b, 7e-247], t$95$1, If[LessEqual[b, 4e-175], c, If[LessEqual[b, 3e-125], t$95$1, If[LessEqual[b, 1.2e-104], c, If[LessEqual[b, 3.5e-33], N[(x * y), $MachinePrecision], If[LessEqual[b, 2.95e+46], c, If[LessEqual[b, 5.4e+174], N[(x * y), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := b \cdot \left(-0.25 \cdot a\right)\\
\mathbf{if}\;b \leq -2.95 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -1.8 \cdot 10^{-114}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -4.5 \cdot 10^{-279}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-175}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-104}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-33}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 2.95 \cdot 10^{+46}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+174}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -2.94999999999999982e-15 or 5.3999999999999998e174 < b Initial program 92.6%
Taylor expanded in a around inf 59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in a around inf 45.0%
associate-*r*45.0%
Simplified45.0%
if -2.94999999999999982e-15 < b < -1.80000000000000009e-114 or -4.49999999999999995e-279 < b < 6.9999999999999998e-247 or 4e-175 < b < 2.9999999999999999e-125Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate--l+100.0%
associate-*l/100.0%
*-commutative100.0%
fma-def100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in b around 0 96.0%
Taylor expanded in t around inf 40.8%
associate-*r*40.8%
*-commutative40.8%
*-commutative40.8%
*-commutative40.8%
Simplified40.8%
if -1.80000000000000009e-114 < b < -4.49999999999999995e-279 or 1.2e-104 < b < 3.4999999999999999e-33 or 2.95e46 < b < 5.3999999999999998e174Initial program 97.5%
associate-+l-97.5%
+-commutative97.5%
associate--l+97.5%
associate-*l/97.5%
*-commutative97.5%
fma-def97.5%
fma-neg97.5%
neg-sub097.5%
associate-+l-97.5%
neg-sub097.5%
+-commutative97.5%
unsub-neg97.5%
*-commutative97.5%
associate-*r/97.5%
Simplified97.5%
Taylor expanded in b around 0 83.1%
Taylor expanded in y around inf 41.3%
if 6.9999999999999998e-247 < b < 4e-175 or 2.9999999999999999e-125 < b < 1.2e-104 or 3.4999999999999999e-33 < b < 2.95e46Initial program 100.0%
Taylor expanded in c around inf 40.1%
Final simplification42.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (+ c (* -0.25 (* b a)))))
(if (<= (* b a) -1e+130)
t_2
(if (<= (* b a) -2e-231)
t_1
(if (<= (* b a) 20000000000000.0)
(+ c (* t (* z 0.0625)))
(if (<= (* b a) 2e+175) 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 = c + (-0.25 * (b * a));
double tmp;
if ((b * a) <= -1e+130) {
tmp = t_2;
} else if ((b * a) <= -2e-231) {
tmp = t_1;
} else if ((b * a) <= 20000000000000.0) {
tmp = c + (t * (z * 0.0625));
} else if ((b * a) <= 2e+175) {
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 = c + ((-0.25d0) * (b * a))
if ((b * a) <= (-1d+130)) then
tmp = t_2
else if ((b * a) <= (-2d-231)) then
tmp = t_1
else if ((b * a) <= 20000000000000.0d0) then
tmp = c + (t * (z * 0.0625d0))
else if ((b * a) <= 2d+175) 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 = c + (-0.25 * (b * a));
double tmp;
if ((b * a) <= -1e+130) {
tmp = t_2;
} else if ((b * a) <= -2e-231) {
tmp = t_1;
} else if ((b * a) <= 20000000000000.0) {
tmp = c + (t * (z * 0.0625));
} else if ((b * a) <= 2e+175) {
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 = c + (-0.25 * (b * a)) tmp = 0 if (b * a) <= -1e+130: tmp = t_2 elif (b * a) <= -2e-231: tmp = t_1 elif (b * a) <= 20000000000000.0: tmp = c + (t * (z * 0.0625)) elif (b * a) <= 2e+175: 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(c + Float64(-0.25 * Float64(b * a))) tmp = 0.0 if (Float64(b * a) <= -1e+130) tmp = t_2; elseif (Float64(b * a) <= -2e-231) tmp = t_1; elseif (Float64(b * a) <= 20000000000000.0) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(b * a) <= 2e+175) 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 = c + (-0.25 * (b * a)); tmp = 0.0; if ((b * a) <= -1e+130) tmp = t_2; elseif ((b * a) <= -2e-231) tmp = t_1; elseif ((b * a) <= 20000000000000.0) tmp = c + (t * (z * 0.0625)); elseif ((b * a) <= 2e+175) 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[(c + N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1e+130], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -2e-231], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 20000000000000.0], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+175], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+130}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 20000000000000:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+175}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.0000000000000001e130 or 1.9999999999999999e175 < (*.f64 a b) Initial program 89.3%
Taylor expanded in a around inf 80.8%
*-commutative80.8%
Simplified80.8%
if -1.0000000000000001e130 < (*.f64 a b) < -2e-231 or 2e13 < (*.f64 a b) < 1.9999999999999999e175Initial program 100.0%
Taylor expanded in x around inf 66.9%
if -2e-231 < (*.f64 a b) < 2e13Initial program 98.9%
Taylor expanded in z around inf 68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
Simplified68.9%
Final simplification71.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)))
(if (or (<= x -1.45e+99)
(not (or (<= x -4e+46) (and (not (<= x -7e-76)) (<= x 3.1e-142)))))
(- (+ c (* x y)) t_1)
(- (+ c (* (* z t) 0.0625)) 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 <= -1.45e+99) || !((x <= -4e+46) || (!(x <= -7e-76) && (x <= 3.1e-142)))) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - 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 <= (-1.45d+99)) .or. (.not. (x <= (-4d+46)) .or. (.not. (x <= (-7d-76))) .and. (x <= 3.1d-142))) then
tmp = (c + (x * y)) - t_1
else
tmp = (c + ((z * t) * 0.0625d0)) - 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 <= -1.45e+99) || !((x <= -4e+46) || (!(x <= -7e-76) && (x <= 3.1e-142)))) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 tmp = 0 if (x <= -1.45e+99) or not ((x <= -4e+46) or (not (x <= -7e-76) and (x <= 3.1e-142))): tmp = (c + (x * y)) - t_1 else: tmp = (c + ((z * t) * 0.0625)) - 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 <= -1.45e+99) || !((x <= -4e+46) || (!(x <= -7e-76) && (x <= 3.1e-142)))) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(c + Float64(Float64(z * t) * 0.0625)) - 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 <= -1.45e+99) || ~(((x <= -4e+46) || (~((x <= -7e-76)) && (x <= 3.1e-142))))) tmp = (c + (x * y)) - t_1; else tmp = (c + ((z * t) * 0.0625)) - 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, -1.45e+99], N[Not[Or[LessEqual[x, -4e+46], And[N[Not[LessEqual[x, -7e-76]], $MachinePrecision], LessEqual[x, 3.1e-142]]]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $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 -1.45 \cdot 10^{+99} \lor \neg \left(x \leq -4 \cdot 10^{+46} \lor \neg \left(x \leq -7 \cdot 10^{-76}\right) \land x \leq 3.1 \cdot 10^{-142}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + \left(z \cdot t\right) \cdot 0.0625\right) - t_1\\
\end{array}
\end{array}
if x < -1.4500000000000001e99 or -4e46 < x < -6.99999999999999995e-76 or 3.1e-142 < x Initial program 95.4%
Taylor expanded in z around 0 78.8%
if -1.4500000000000001e99 < x < -4e46 or -6.99999999999999995e-76 < x < 3.1e-142Initial program 98.0%
Taylor expanded in x around 0 92.4%
Final simplification84.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -1e+130)
(+ c (* -0.25 (* b a)))
(if (<= (* b a) -2e-231)
(+ c (* x y))
(if (<= (* b a) 20000000000000.0)
(+ c (* t (* z 0.0625)))
(- (* x y) (* (* b a) 0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -1e+130) {
tmp = c + (-0.25 * (b * a));
} else if ((b * a) <= -2e-231) {
tmp = c + (x * y);
} else if ((b * a) <= 20000000000000.0) {
tmp = c + (t * (z * 0.0625));
} 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) :: tmp
if ((b * a) <= (-1d+130)) then
tmp = c + ((-0.25d0) * (b * a))
else if ((b * a) <= (-2d-231)) then
tmp = c + (x * y)
else if ((b * a) <= 20000000000000.0d0) then
tmp = c + (t * (z * 0.0625d0))
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 tmp;
if ((b * a) <= -1e+130) {
tmp = c + (-0.25 * (b * a));
} else if ((b * a) <= -2e-231) {
tmp = c + (x * y);
} else if ((b * a) <= 20000000000000.0) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = (x * y) - ((b * a) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b * a) <= -1e+130: tmp = c + (-0.25 * (b * a)) elif (b * a) <= -2e-231: tmp = c + (x * y) elif (b * a) <= 20000000000000.0: tmp = c + (t * (z * 0.0625)) else: tmp = (x * y) - ((b * a) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -1e+130) tmp = Float64(c + Float64(-0.25 * Float64(b * a))); elseif (Float64(b * a) <= -2e-231) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 20000000000000.0) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); 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) tmp = 0.0; if ((b * a) <= -1e+130) tmp = c + (-0.25 * (b * a)); elseif ((b * a) <= -2e-231) tmp = c + (x * y); elseif ((b * a) <= 20000000000000.0) tmp = c + (t * (z * 0.0625)); else tmp = (x * y) - ((b * a) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -1e+130], N[(c + N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -2e-231], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 20000000000000.0], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+130}:\\
\;\;\;\;c + -0.25 \cdot \left(b \cdot a\right)\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-231}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 20000000000000:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -1.0000000000000001e130Initial program 90.2%
Taylor expanded in a around inf 81.7%
*-commutative81.7%
Simplified81.7%
if -1.0000000000000001e130 < (*.f64 a b) < -2e-231Initial program 100.0%
Taylor expanded in x around inf 66.1%
if -2e-231 < (*.f64 a b) < 2e13Initial program 98.9%
Taylor expanded in z around inf 68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
Simplified68.9%
if 2e13 < (*.f64 a b) Initial program 93.3%
Taylor expanded in z around 0 83.6%
Taylor expanded in c around 0 70.2%
Final simplification70.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= y -5.8e-112)
(* x y)
(if (<= y 1.8e+20)
c
(if (<= y 1.7e+44)
(* x y)
(if (<= y 1.35e+67)
c
(if (<= y 9.2e+90) (* z (* t 0.0625)) (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -5.8e-112) {
tmp = x * y;
} else if (y <= 1.8e+20) {
tmp = c;
} else if (y <= 1.7e+44) {
tmp = x * y;
} else if (y <= 1.35e+67) {
tmp = c;
} else if (y <= 9.2e+90) {
tmp = z * (t * 0.0625);
} 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 <= (-5.8d-112)) then
tmp = x * y
else if (y <= 1.8d+20) then
tmp = c
else if (y <= 1.7d+44) then
tmp = x * y
else if (y <= 1.35d+67) then
tmp = c
else if (y <= 9.2d+90) then
tmp = z * (t * 0.0625d0)
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 <= -5.8e-112) {
tmp = x * y;
} else if (y <= 1.8e+20) {
tmp = c;
} else if (y <= 1.7e+44) {
tmp = x * y;
} else if (y <= 1.35e+67) {
tmp = c;
} else if (y <= 9.2e+90) {
tmp = z * (t * 0.0625);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -5.8e-112: tmp = x * y elif y <= 1.8e+20: tmp = c elif y <= 1.7e+44: tmp = x * y elif y <= 1.35e+67: tmp = c elif y <= 9.2e+90: tmp = z * (t * 0.0625) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -5.8e-112) tmp = Float64(x * y); elseif (y <= 1.8e+20) tmp = c; elseif (y <= 1.7e+44) tmp = Float64(x * y); elseif (y <= 1.35e+67) tmp = c; elseif (y <= 9.2e+90) tmp = Float64(z * Float64(t * 0.0625)); 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 <= -5.8e-112) tmp = x * y; elseif (y <= 1.8e+20) tmp = c; elseif (y <= 1.7e+44) tmp = x * y; elseif (y <= 1.35e+67) tmp = c; elseif (y <= 9.2e+90) tmp = z * (t * 0.0625); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -5.8e-112], N[(x * y), $MachinePrecision], If[LessEqual[y, 1.8e+20], c, If[LessEqual[y, 1.7e+44], N[(x * y), $MachinePrecision], If[LessEqual[y, 1.35e+67], c, If[LessEqual[y, 9.2e+90], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-112}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+20}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+44}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+67}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+90}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -5.79999999999999985e-112 or 1.8e20 < y < 1.7e44 or 9.20000000000000001e90 < y Initial program 96.0%
associate-+l-96.0%
+-commutative96.0%
associate--l+96.0%
associate-*l/96.0%
*-commutative96.0%
fma-def96.7%
fma-neg98.0%
neg-sub098.0%
associate-+l-98.0%
neg-sub098.0%
+-commutative98.0%
unsub-neg98.0%
*-commutative98.0%
associate-*r/98.0%
Simplified98.0%
Taylor expanded in b around 0 75.2%
Taylor expanded in y around inf 44.2%
if -5.79999999999999985e-112 < y < 1.8e20 or 1.7e44 < y < 1.35e67Initial program 97.1%
Taylor expanded in c around inf 34.0%
if 1.35e67 < y < 9.20000000000000001e90Initial program 100.0%
associate-+l-100.0%
+-commutative100.0%
associate--l+100.0%
associate-*l/100.0%
*-commutative100.0%
fma-def100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in b around 0 100.0%
Taylor expanded in t around inf 50.8%
associate-*r*50.8%
*-commutative50.8%
*-commutative50.8%
*-commutative50.8%
Simplified50.8%
Final simplification40.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))) (t_2 (+ c (* x y))) (t_3 (* b (* -0.25 a))))
(if (<= b -3.4e-16)
t_3
(if (<= b -2.7e-114)
t_1
(if (<= b -2.4e-279)
t_2
(if (<= b 1.1e-285) t_1 (if (<= b 1.8e+175) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double t_2 = c + (x * y);
double t_3 = b * (-0.25 * a);
double tmp;
if (b <= -3.4e-16) {
tmp = t_3;
} else if (b <= -2.7e-114) {
tmp = t_1;
} else if (b <= -2.4e-279) {
tmp = t_2;
} else if (b <= 1.1e-285) {
tmp = t_1;
} else if (b <= 1.8e+175) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z * (t * 0.0625d0)
t_2 = c + (x * y)
t_3 = b * ((-0.25d0) * a)
if (b <= (-3.4d-16)) then
tmp = t_3
else if (b <= (-2.7d-114)) then
tmp = t_1
else if (b <= (-2.4d-279)) then
tmp = t_2
else if (b <= 1.1d-285) then
tmp = t_1
else if (b <= 1.8d+175) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double t_2 = c + (x * y);
double t_3 = b * (-0.25 * a);
double tmp;
if (b <= -3.4e-16) {
tmp = t_3;
} else if (b <= -2.7e-114) {
tmp = t_1;
} else if (b <= -2.4e-279) {
tmp = t_2;
} else if (b <= 1.1e-285) {
tmp = t_1;
} else if (b <= 1.8e+175) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) t_2 = c + (x * y) t_3 = b * (-0.25 * a) tmp = 0 if b <= -3.4e-16: tmp = t_3 elif b <= -2.7e-114: tmp = t_1 elif b <= -2.4e-279: tmp = t_2 elif b <= 1.1e-285: tmp = t_1 elif b <= 1.8e+175: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) t_2 = Float64(c + Float64(x * y)) t_3 = Float64(b * Float64(-0.25 * a)) tmp = 0.0 if (b <= -3.4e-16) tmp = t_3; elseif (b <= -2.7e-114) tmp = t_1; elseif (b <= -2.4e-279) tmp = t_2; elseif (b <= 1.1e-285) tmp = t_1; elseif (b <= 1.8e+175) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = z * (t * 0.0625); t_2 = c + (x * y); t_3 = b * (-0.25 * a); tmp = 0.0; if (b <= -3.4e-16) tmp = t_3; elseif (b <= -2.7e-114) tmp = t_1; elseif (b <= -2.4e-279) tmp = t_2; elseif (b <= 1.1e-285) tmp = t_1; elseif (b <= 1.8e+175) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(-0.25 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.4e-16], t$95$3, If[LessEqual[b, -2.7e-114], t$95$1, If[LessEqual[b, -2.4e-279], t$95$2, If[LessEqual[b, 1.1e-285], t$95$1, If[LessEqual[b, 1.8e+175], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
t_3 := b \cdot \left(-0.25 \cdot a\right)\\
\mathbf{if}\;b \leq -3.4 \cdot 10^{-16}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq -2.7 \cdot 10^{-114}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.4 \cdot 10^{-279}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+175}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if b < -3.4e-16 or 1.80000000000000017e175 < b Initial program 92.6%
Taylor expanded in a around inf 59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in a around inf 45.0%
associate-*r*45.0%
Simplified45.0%
if -3.4e-16 < b < -2.7e-114 or -2.3999999999999999e-279 < b < 1.1e-285Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate--l+99.9%
associate-*l/99.9%
*-commutative99.9%
fma-def100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
*-commutative100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in b around 0 97.2%
Taylor expanded in t around inf 45.7%
associate-*r*45.7%
*-commutative45.7%
*-commutative45.7%
*-commutative45.7%
Simplified45.7%
if -2.7e-114 < b < -2.3999999999999999e-279 or 1.1e-285 < b < 1.80000000000000017e175Initial program 98.5%
Taylor expanded in x around inf 60.3%
Final simplification53.2%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= x -1.55e+100)
(not (or (<= x -2.6e-36) (and (not (<= x -2.4e-51)) (<= x 82.0)))))
(+ c (* x y))
(+ c (* t (* z 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x <= -1.55e+100) || !((x <= -2.6e-36) || (!(x <= -2.4e-51) && (x <= 82.0)))) {
tmp = c + (x * y);
} else {
tmp = c + (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) :: tmp
if ((x <= (-1.55d+100)) .or. (.not. (x <= (-2.6d-36)) .or. (.not. (x <= (-2.4d-51))) .and. (x <= 82.0d0))) then
tmp = c + (x * y)
else
tmp = c + (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 tmp;
if ((x <= -1.55e+100) || !((x <= -2.6e-36) || (!(x <= -2.4e-51) && (x <= 82.0)))) {
tmp = c + (x * y);
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x <= -1.55e+100) or not ((x <= -2.6e-36) or (not (x <= -2.4e-51) and (x <= 82.0))): tmp = c + (x * y) else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((x <= -1.55e+100) || !((x <= -2.6e-36) || (!(x <= -2.4e-51) && (x <= 82.0)))) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x <= -1.55e+100) || ~(((x <= -2.6e-36) || (~((x <= -2.4e-51)) && (x <= 82.0))))) tmp = c + (x * y); else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[x, -1.55e+100], N[Not[Or[LessEqual[x, -2.6e-36], And[N[Not[LessEqual[x, -2.4e-51]], $MachinePrecision], LessEqual[x, 82.0]]]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+100} \lor \neg \left(x \leq -2.6 \cdot 10^{-36} \lor \neg \left(x \leq -2.4 \cdot 10^{-51}\right) \land x \leq 82\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if x < -1.55000000000000003e100 or -2.6e-36 < x < -2.4e-51 or 82 < x Initial program 93.4%
Taylor expanded in x around inf 64.7%
if -1.55000000000000003e100 < x < -2.6e-36 or -2.4e-51 < x < 82Initial program 98.6%
Taylor expanded in z around inf 63.8%
*-commutative63.8%
associate-*r*63.8%
*-commutative63.8%
Simplified63.8%
Final simplification64.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -6.2e+45) (not (<= t 3.9e+199))) (+ c (* t (* z 0.0625))) (- (+ c (* x y)) (* (* b a) 0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -6.2e+45) || !(t <= 3.9e+199)) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = (c + (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) :: tmp
if ((t <= (-6.2d+45)) .or. (.not. (t <= 3.9d+199))) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = (c + (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 tmp;
if ((t <= -6.2e+45) || !(t <= 3.9e+199)) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = (c + (x * y)) - ((b * a) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -6.2e+45) or not (t <= 3.9e+199): tmp = c + (t * (z * 0.0625)) else: tmp = (c + (x * y)) - ((b * a) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -6.2e+45) || !(t <= 3.9e+199)) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((t <= -6.2e+45) || ~((t <= 3.9e+199))) tmp = c + (t * (z * 0.0625)); else tmp = (c + (x * y)) - ((b * a) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -6.2e+45], N[Not[LessEqual[t, 3.9e+199]], $MachinePrecision]], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+45} \lor \neg \left(t \leq 3.9 \cdot 10^{+199}\right):\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\end{array}
\end{array}
if t < -6.19999999999999975e45 or 3.9000000000000002e199 < t Initial program 93.5%
Taylor expanded in z around inf 63.7%
*-commutative63.7%
associate-*r*63.7%
*-commutative63.7%
Simplified63.7%
if -6.19999999999999975e45 < t < 3.9000000000000002e199Initial program 97.8%
Taylor expanded in z around 0 80.8%
Final simplification75.7%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -6.5e-112) (* x y) (if (<= y 2.9e+19) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -6.5e-112) {
tmp = x * y;
} else if (y <= 2.9e+19) {
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 <= (-6.5d-112)) then
tmp = x * y
else if (y <= 2.9d+19) 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 <= -6.5e-112) {
tmp = x * y;
} else if (y <= 2.9e+19) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -6.5e-112: tmp = x * y elif y <= 2.9e+19: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -6.5e-112) tmp = Float64(x * y); elseif (y <= 2.9e+19) 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 <= -6.5e-112) tmp = x * y; elseif (y <= 2.9e+19) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -6.5e-112], N[(x * y), $MachinePrecision], If[LessEqual[y, 2.9e+19], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-112}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+19}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -6.49999999999999956e-112 or 2.9e19 < y Initial program 96.2%
associate-+l-96.2%
+-commutative96.2%
associate--l+96.2%
associate-*l/96.2%
*-commutative96.2%
fma-def96.8%
fma-neg98.1%
neg-sub098.1%
associate-+l-98.1%
neg-sub098.1%
+-commutative98.1%
unsub-neg98.1%
*-commutative98.1%
associate-*r/98.1%
Simplified98.1%
Taylor expanded in b around 0 75.4%
Taylor expanded in y around inf 43.6%
if -6.49999999999999956e-112 < y < 2.9e19Initial program 97.0%
Taylor expanded in c around inf 33.2%
Final simplification39.5%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.5%
Taylor expanded in c around inf 22.4%
Final simplification22.4%
herbie shell --seed 2023192
(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))