
(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 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 fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 98.0%
associate--l+98.0%
fma-define99.2%
associate-/l*99.2%
fma-neg99.6%
distribute-neg-frac299.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 98.0%
associate-+l-98.0%
*-commutative98.0%
associate-+l-98.0%
fma-define98.4%
*-commutative98.4%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))))
(if (<= (* x y) -1.18e+83)
(* x y)
(if (<= (* x y) -3.9e+34)
t_1
(if (<= (* x y) -8.2e-268)
c
(if (<= (* x y) 1.32e-306)
t_1
(if (<= (* x y) 3.5e-223)
c
(if (<= (* x y) 6.6e-98)
t_1
(if (<= (* x y) 1e-85)
c
(if (<= (* x y) 6.6e-79)
t_1
(if (<= (* x y) 4.3e-75)
(* a (* b -0.25))
(if (<= (* x y) 2.15e+51)
c
(if (<= (* x y) 2.2e+112) t_1 (* x y))))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.18e+83) {
tmp = x * y;
} else if ((x * y) <= -3.9e+34) {
tmp = t_1;
} else if ((x * y) <= -8.2e-268) {
tmp = c;
} else if ((x * y) <= 1.32e-306) {
tmp = t_1;
} else if ((x * y) <= 3.5e-223) {
tmp = c;
} else if ((x * y) <= 6.6e-98) {
tmp = t_1;
} else if ((x * y) <= 1e-85) {
tmp = c;
} else if ((x * y) <= 6.6e-79) {
tmp = t_1;
} else if ((x * y) <= 4.3e-75) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 2.15e+51) {
tmp = c;
} else if ((x * y) <= 2.2e+112) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = z * (t * 0.0625d0)
if ((x * y) <= (-1.18d+83)) then
tmp = x * y
else if ((x * y) <= (-3.9d+34)) then
tmp = t_1
else if ((x * y) <= (-8.2d-268)) then
tmp = c
else if ((x * y) <= 1.32d-306) then
tmp = t_1
else if ((x * y) <= 3.5d-223) then
tmp = c
else if ((x * y) <= 6.6d-98) then
tmp = t_1
else if ((x * y) <= 1d-85) then
tmp = c
else if ((x * y) <= 6.6d-79) then
tmp = t_1
else if ((x * y) <= 4.3d-75) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 2.15d+51) then
tmp = c
else if ((x * y) <= 2.2d+112) 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 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.18e+83) {
tmp = x * y;
} else if ((x * y) <= -3.9e+34) {
tmp = t_1;
} else if ((x * y) <= -8.2e-268) {
tmp = c;
} else if ((x * y) <= 1.32e-306) {
tmp = t_1;
} else if ((x * y) <= 3.5e-223) {
tmp = c;
} else if ((x * y) <= 6.6e-98) {
tmp = t_1;
} else if ((x * y) <= 1e-85) {
tmp = c;
} else if ((x * y) <= 6.6e-79) {
tmp = t_1;
} else if ((x * y) <= 4.3e-75) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 2.15e+51) {
tmp = c;
} else if ((x * y) <= 2.2e+112) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) tmp = 0 if (x * y) <= -1.18e+83: tmp = x * y elif (x * y) <= -3.9e+34: tmp = t_1 elif (x * y) <= -8.2e-268: tmp = c elif (x * y) <= 1.32e-306: tmp = t_1 elif (x * y) <= 3.5e-223: tmp = c elif (x * y) <= 6.6e-98: tmp = t_1 elif (x * y) <= 1e-85: tmp = c elif (x * y) <= 6.6e-79: tmp = t_1 elif (x * y) <= 4.3e-75: tmp = a * (b * -0.25) elif (x * y) <= 2.15e+51: tmp = c elif (x * y) <= 2.2e+112: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -1.18e+83) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.9e+34) tmp = t_1; elseif (Float64(x * y) <= -8.2e-268) tmp = c; elseif (Float64(x * y) <= 1.32e-306) tmp = t_1; elseif (Float64(x * y) <= 3.5e-223) tmp = c; elseif (Float64(x * y) <= 6.6e-98) tmp = t_1; elseif (Float64(x * y) <= 1e-85) tmp = c; elseif (Float64(x * y) <= 6.6e-79) tmp = t_1; elseif (Float64(x * y) <= 4.3e-75) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 2.15e+51) tmp = c; elseif (Float64(x * y) <= 2.2e+112) 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 = z * (t * 0.0625); tmp = 0.0; if ((x * y) <= -1.18e+83) tmp = x * y; elseif ((x * y) <= -3.9e+34) tmp = t_1; elseif ((x * y) <= -8.2e-268) tmp = c; elseif ((x * y) <= 1.32e-306) tmp = t_1; elseif ((x * y) <= 3.5e-223) tmp = c; elseif ((x * y) <= 6.6e-98) tmp = t_1; elseif ((x * y) <= 1e-85) tmp = c; elseif ((x * y) <= 6.6e-79) tmp = t_1; elseif ((x * y) <= 4.3e-75) tmp = a * (b * -0.25); elseif ((x * y) <= 2.15e+51) tmp = c; elseif ((x * y) <= 2.2e+112) 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[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.18e+83], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.9e+34], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -8.2e-268], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.32e-306], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e-223], c, If[LessEqual[N[(x * y), $MachinePrecision], 6.6e-98], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-85], c, If[LessEqual[N[(x * y), $MachinePrecision], 6.6e-79], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.3e-75], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.15e+51], c, If[LessEqual[N[(x * y), $MachinePrecision], 2.2e+112], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.18 \cdot 10^{+83}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.9 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{-268}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.32 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-223}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-85}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.3 \cdot 10^{-75}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 2.15 \cdot 10^{+51}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.1799999999999999e83 or 2.1999999999999999e112 < (*.f64 x y) Initial program 94.8%
Taylor expanded in y around inf 95.9%
Taylor expanded in a around 0 91.9%
Taylor expanded in y around inf 71.0%
if -1.1799999999999999e83 < (*.f64 x y) < -3.90000000000000019e34 or -8.1999999999999998e-268 < (*.f64 x y) < 1.32e-306 or 3.50000000000000009e-223 < (*.f64 x y) < 6.6000000000000002e-98 or 9.9999999999999998e-86 < (*.f64 x y) < 6.5999999999999996e-79 or 2.1499999999999999e51 < (*.f64 x y) < 2.1999999999999999e112Initial program 100.0%
Taylor expanded in z around inf 85.3%
Taylor expanded in t around inf 52.3%
if -3.90000000000000019e34 < (*.f64 x y) < -8.1999999999999998e-268 or 1.32e-306 < (*.f64 x y) < 3.50000000000000009e-223 or 6.6000000000000002e-98 < (*.f64 x y) < 9.9999999999999998e-86 or 4.2999999999999999e-75 < (*.f64 x y) < 2.1499999999999999e51Initial program 100.0%
Taylor expanded in c around inf 50.2%
if 6.5999999999999996e-79 < (*.f64 x y) < 4.2999999999999999e-75Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in a around inf 75.3%
*-commutative75.3%
associate-*l*75.3%
Simplified75.3%
Final simplification59.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))))
(if (<= (* x y) -1.8e+83)
(* x y)
(if (<= (* x y) -8.8e+36)
t_1
(if (<= (* x y) -1.56e-24)
(* x y)
(if (<= (* x y) -8.8e-132)
(* z (/ c z))
(if (<= (* x y) 2.75e+50)
c
(if (<= (* x y) 8e+116)
t_1
(if (<= (* x y) 8.1e+117) c (* x y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.8e+83) {
tmp = x * y;
} else if ((x * y) <= -8.8e+36) {
tmp = t_1;
} else if ((x * y) <= -1.56e-24) {
tmp = x * y;
} else if ((x * y) <= -8.8e-132) {
tmp = z * (c / z);
} else if ((x * y) <= 2.75e+50) {
tmp = c;
} else if ((x * y) <= 8e+116) {
tmp = t_1;
} else if ((x * y) <= 8.1e+117) {
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) :: t_1
real(8) :: tmp
t_1 = z * (t * 0.0625d0)
if ((x * y) <= (-1.8d+83)) then
tmp = x * y
else if ((x * y) <= (-8.8d+36)) then
tmp = t_1
else if ((x * y) <= (-1.56d-24)) then
tmp = x * y
else if ((x * y) <= (-8.8d-132)) then
tmp = z * (c / z)
else if ((x * y) <= 2.75d+50) then
tmp = c
else if ((x * y) <= 8d+116) then
tmp = t_1
else if ((x * y) <= 8.1d+117) 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 t_1 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.8e+83) {
tmp = x * y;
} else if ((x * y) <= -8.8e+36) {
tmp = t_1;
} else if ((x * y) <= -1.56e-24) {
tmp = x * y;
} else if ((x * y) <= -8.8e-132) {
tmp = z * (c / z);
} else if ((x * y) <= 2.75e+50) {
tmp = c;
} else if ((x * y) <= 8e+116) {
tmp = t_1;
} else if ((x * y) <= 8.1e+117) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) tmp = 0 if (x * y) <= -1.8e+83: tmp = x * y elif (x * y) <= -8.8e+36: tmp = t_1 elif (x * y) <= -1.56e-24: tmp = x * y elif (x * y) <= -8.8e-132: tmp = z * (c / z) elif (x * y) <= 2.75e+50: tmp = c elif (x * y) <= 8e+116: tmp = t_1 elif (x * y) <= 8.1e+117: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -1.8e+83) tmp = Float64(x * y); elseif (Float64(x * y) <= -8.8e+36) tmp = t_1; elseif (Float64(x * y) <= -1.56e-24) tmp = Float64(x * y); elseif (Float64(x * y) <= -8.8e-132) tmp = Float64(z * Float64(c / z)); elseif (Float64(x * y) <= 2.75e+50) tmp = c; elseif (Float64(x * y) <= 8e+116) tmp = t_1; elseif (Float64(x * y) <= 8.1e+117) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = z * (t * 0.0625); tmp = 0.0; if ((x * y) <= -1.8e+83) tmp = x * y; elseif ((x * y) <= -8.8e+36) tmp = t_1; elseif ((x * y) <= -1.56e-24) tmp = x * y; elseif ((x * y) <= -8.8e-132) tmp = z * (c / z); elseif ((x * y) <= 2.75e+50) tmp = c; elseif ((x * y) <= 8e+116) tmp = t_1; elseif ((x * y) <= 8.1e+117) tmp = c; else tmp = x * y; 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]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+83], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -8.8e+36], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.56e-24], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -8.8e-132], N[(z * N[(c / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.75e+50], c, If[LessEqual[N[(x * y), $MachinePrecision], 8e+116], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.1e+117], c, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+83}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -8.8 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.56 \cdot 10^{-24}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -8.8 \cdot 10^{-132}:\\
\;\;\;\;z \cdot \frac{c}{z}\\
\mathbf{elif}\;x \cdot y \leq 2.75 \cdot 10^{+50}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 8.1 \cdot 10^{+117}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.7999999999999999e83 or -8.80000000000000002e36 < (*.f64 x y) < -1.56e-24 or 8.0999999999999996e117 < (*.f64 x y) Initial program 95.3%
Taylor expanded in y around inf 96.2%
Taylor expanded in a around 0 90.7%
Taylor expanded in y around inf 70.7%
if -1.7999999999999999e83 < (*.f64 x y) < -8.80000000000000002e36 or 2.7499999999999999e50 < (*.f64 x y) < 8.00000000000000012e116Initial program 100.0%
Taylor expanded in z around inf 79.9%
Taylor expanded in t around inf 59.5%
if -1.56e-24 < (*.f64 x y) < -8.79999999999999963e-132Initial program 99.9%
Taylor expanded in z around inf 94.7%
Taylor expanded in c around inf 36.2%
if -8.79999999999999963e-132 < (*.f64 x y) < 2.7499999999999999e50 or 8.00000000000000012e116 < (*.f64 x y) < 8.0999999999999996e117Initial program 100.0%
Taylor expanded in c around inf 42.9%
Final simplification55.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 (+ c (* a (* b -0.25)))))
(if (<= (* x y) -1e+77)
t_2
(if (<= (* x y) -5e+38)
t_1
(if (<= (* x y) -2e+34)
(* x y)
(if (<= (* x y) 4e-205)
t_3
(if (<= (* x y) 1e-84) t_1 (if (<= (* x y) 5e+48) t_3 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 = c + (x * y);
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -1e+77) {
tmp = t_2;
} else if ((x * y) <= -5e+38) {
tmp = t_1;
} else if ((x * y) <= -2e+34) {
tmp = x * y;
} else if ((x * y) <= 4e-205) {
tmp = t_3;
} else if ((x * y) <= 1e-84) {
tmp = t_1;
} else if ((x * y) <= 5e+48) {
tmp = t_3;
} 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 = z * (t * 0.0625d0)
t_2 = c + (x * y)
t_3 = c + (a * (b * (-0.25d0)))
if ((x * y) <= (-1d+77)) then
tmp = t_2
else if ((x * y) <= (-5d+38)) then
tmp = t_1
else if ((x * y) <= (-2d+34)) then
tmp = x * y
else if ((x * y) <= 4d-205) then
tmp = t_3
else if ((x * y) <= 1d-84) then
tmp = t_1
else if ((x * y) <= 5d+48) then
tmp = t_3
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 = c + (x * y);
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -1e+77) {
tmp = t_2;
} else if ((x * y) <= -5e+38) {
tmp = t_1;
} else if ((x * y) <= -2e+34) {
tmp = x * y;
} else if ((x * y) <= 4e-205) {
tmp = t_3;
} else if ((x * y) <= 1e-84) {
tmp = t_1;
} else if ((x * y) <= 5e+48) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) t_2 = c + (x * y) t_3 = c + (a * (b * -0.25)) tmp = 0 if (x * y) <= -1e+77: tmp = t_2 elif (x * y) <= -5e+38: tmp = t_1 elif (x * y) <= -2e+34: tmp = x * y elif (x * y) <= 4e-205: tmp = t_3 elif (x * y) <= 1e-84: tmp = t_1 elif (x * y) <= 5e+48: tmp = t_3 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(c + Float64(x * y)) t_3 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(x * y) <= -1e+77) tmp = t_2; elseif (Float64(x * y) <= -5e+38) tmp = t_1; elseif (Float64(x * y) <= -2e+34) tmp = Float64(x * y); elseif (Float64(x * y) <= 4e-205) tmp = t_3; elseif (Float64(x * y) <= 1e-84) tmp = t_1; elseif (Float64(x * y) <= 5e+48) tmp = t_3; 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 = c + (x * y); t_3 = c + (a * (b * -0.25)); tmp = 0.0; if ((x * y) <= -1e+77) tmp = t_2; elseif ((x * y) <= -5e+38) tmp = t_1; elseif ((x * y) <= -2e+34) tmp = x * y; elseif ((x * y) <= 4e-205) tmp = t_3; elseif ((x * y) <= 1e-84) tmp = t_1; elseif ((x * y) <= 5e+48) tmp = t_3; 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[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+77], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e+38], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e+34], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e-205], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 1e-84], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+48], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
t_3 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+77}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+34}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-205}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 10^{-84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+48}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999983e76 or 4.99999999999999973e48 < (*.f64 x y) Initial program 95.5%
Taylor expanded in x around inf 73.9%
if -9.99999999999999983e76 < (*.f64 x y) < -4.9999999999999997e38 or 4e-205 < (*.f64 x y) < 1e-84Initial program 99.9%
Taylor expanded in z around inf 87.0%
Taylor expanded in t around inf 65.5%
if -4.9999999999999997e38 < (*.f64 x y) < -1.99999999999999989e34Initial program 100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 100.0%
if -1.99999999999999989e34 < (*.f64 x y) < 4e-205 or 1e-84 < (*.f64 x y) < 4.99999999999999973e48Initial program 100.0%
Taylor expanded in a around inf 66.4%
*-commutative66.4%
associate-*r*66.4%
Simplified66.4%
Final simplification69.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -4e+25)
(+ (* x y) (* 0.0625 (* z t)))
(if (<= (* x y) -2e-29)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 5e+49)
(+ c (* t (* z 0.0625)))
(* y (+ x (* 0.0625 (/ (* z t) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -4e+25) {
tmp = (x * y) + (0.0625 * (z * t));
} else if ((x * y) <= -2e-29) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 5e+49) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = y * (x + (0.0625 * ((z * t) / 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 * y) <= (-4d+25)) then
tmp = (x * y) + (0.0625d0 * (z * t))
else if ((x * y) <= (-2d-29)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 5d+49) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = y * (x + (0.0625d0 * ((z * t) / 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 * y) <= -4e+25) {
tmp = (x * y) + (0.0625 * (z * t));
} else if ((x * y) <= -2e-29) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 5e+49) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = y * (x + (0.0625 * ((z * t) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -4e+25: tmp = (x * y) + (0.0625 * (z * t)) elif (x * y) <= -2e-29: tmp = c + (a * (b * -0.25)) elif (x * y) <= 5e+49: tmp = c + (t * (z * 0.0625)) else: tmp = y * (x + (0.0625 * ((z * t) / y))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -4e+25) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= -2e-29) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 5e+49) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -4e+25) tmp = (x * y) + (0.0625 * (z * t)); elseif ((x * y) <= -2e-29) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 5e+49) tmp = c + (t * (z * 0.0625)); else tmp = y * (x + (0.0625 * ((z * t) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e+25], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-29], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+49], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+25}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-29}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+49}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000036e25Initial program 98.1%
Taylor expanded in y around inf 98.1%
Taylor expanded in a around 0 85.1%
Taylor expanded in c around 0 77.4%
Taylor expanded in y around 0 77.4%
if -4.00000000000000036e25 < (*.f64 x y) < -1.99999999999999989e-29Initial program 100.0%
Taylor expanded in a around inf 76.4%
*-commutative76.4%
associate-*r*76.4%
Simplified76.4%
if -1.99999999999999989e-29 < (*.f64 x y) < 5.0000000000000004e49Initial program 100.0%
Taylor expanded in z around inf 76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*r*76.4%
Simplified76.4%
if 5.0000000000000004e49 < (*.f64 x y) Initial program 94.1%
Taylor expanded in y around inf 94.2%
Taylor expanded in a around 0 92.8%
Taylor expanded in c around 0 85.6%
Final simplification79.1%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= (* x y) -1.24e+33)
(not
(or (<= (* x y) 7.5e+49)
(and (not (<= (* x y) 2.46e+241)) (<= (* x y) 9.2e+246)))))
(* x y)
c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.24e+33) || !(((x * y) <= 7.5e+49) || (!((x * y) <= 2.46e+241) && ((x * y) <= 9.2e+246)))) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-1.24d+33)) .or. (.not. ((x * y) <= 7.5d+49) .or. (.not. ((x * y) <= 2.46d+241)) .and. ((x * y) <= 9.2d+246))) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.24e+33) || !(((x * y) <= 7.5e+49) || (!((x * y) <= 2.46e+241) && ((x * y) <= 9.2e+246)))) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.24e+33) or not (((x * y) <= 7.5e+49) or (not ((x * y) <= 2.46e+241) and ((x * y) <= 9.2e+246))): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.24e+33) || !((Float64(x * y) <= 7.5e+49) || (!(Float64(x * y) <= 2.46e+241) && (Float64(x * y) <= 9.2e+246)))) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.24e+33) || ~((((x * y) <= 7.5e+49) || (~(((x * y) <= 2.46e+241)) && ((x * y) <= 9.2e+246))))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.24e+33], N[Not[Or[LessEqual[N[(x * y), $MachinePrecision], 7.5e+49], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.46e+241]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 9.2e+246]]]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.24 \cdot 10^{+33} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+49} \lor \neg \left(x \cdot y \leq 2.46 \cdot 10^{+241}\right) \land x \cdot y \leq 9.2 \cdot 10^{+246}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.23999999999999997e33 or 7.4999999999999995e49 < (*.f64 x y) < 2.46000000000000003e241 or 9.20000000000000055e246 < (*.f64 x y) Initial program 95.7%
Taylor expanded in y around inf 95.7%
Taylor expanded in a around 0 89.1%
Taylor expanded in y around inf 64.0%
if -1.23999999999999997e33 < (*.f64 x y) < 7.4999999999999995e49 or 2.46000000000000003e241 < (*.f64 x y) < 9.20000000000000055e246Initial program 100.0%
Taylor expanded in c around inf 41.5%
Final simplification51.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (* 0.0625 (* z t)))))
(if (<= (* x y) -4e+25)
t_1
(if (<= (* x y) -2e-29)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 5e+49) (+ c (* t (* z 0.0625))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -4e+25) {
tmp = t_1;
} else if ((x * y) <= -2e-29) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 5e+49) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (0.0625d0 * (z * t))
if ((x * y) <= (-4d+25)) then
tmp = t_1
else if ((x * y) <= (-2d-29)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 5d+49) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -4e+25) {
tmp = t_1;
} else if ((x * y) <= -2e-29) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 5e+49) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) + (0.0625 * (z * t)) tmp = 0 if (x * y) <= -4e+25: tmp = t_1 elif (x * y) <= -2e-29: tmp = c + (a * (b * -0.25)) elif (x * y) <= 5e+49: tmp = c + (t * (z * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))) tmp = 0.0 if (Float64(x * y) <= -4e+25) tmp = t_1; elseif (Float64(x * y) <= -2e-29) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 5e+49) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) + (0.0625 * (z * t)); tmp = 0.0; if ((x * y) <= -4e+25) tmp = t_1; elseif ((x * y) <= -2e-29) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 5e+49) tmp = c + (t * (z * 0.0625)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e+25], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-29], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+49], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-29}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+49}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000036e25 or 5.0000000000000004e49 < (*.f64 x y) Initial program 95.8%
Taylor expanded in y around inf 95.9%
Taylor expanded in a around 0 89.5%
Taylor expanded in c around 0 82.0%
Taylor expanded in y around 0 82.0%
if -4.00000000000000036e25 < (*.f64 x y) < -1.99999999999999989e-29Initial program 100.0%
Taylor expanded in a around inf 76.4%
*-commutative76.4%
associate-*r*76.4%
Simplified76.4%
if -1.99999999999999989e-29 < (*.f64 x y) < 5.0000000000000004e49Initial program 100.0%
Taylor expanded in z around inf 76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*r*76.4%
Simplified76.4%
Final simplification79.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* x y) -2e+83) (not (<= (* x y) 2e+49)))
(+ c (+ (* x y) t_1))
(- (+ c t_1) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -2e+83) || !((x * y) <= 2e+49)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((x * y) <= (-2d+83)) .or. (.not. ((x * y) <= 2d+49))) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + t_1) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -2e+83) || !((x * y) <= 2e+49)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((x * y) <= -2e+83) or not ((x * y) <= 2e+49): tmp = c + ((x * y) + t_1) else: tmp = (c + t_1) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(x * y) <= -2e+83) || !(Float64(x * y) <= 2e+49)) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((x * y) <= -2e+83) || ~(((x * y) <= 2e+49))) tmp = c + ((x * y) + t_1); else tmp = (c + t_1) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+83], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+49]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+83} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+49}\right):\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t\_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000006e83 or 1.99999999999999989e49 < (*.f64 x y) Initial program 95.4%
Taylor expanded in a around 0 90.1%
if -2.00000000000000006e83 < (*.f64 x y) < 1.99999999999999989e49Initial program 100.0%
Taylor expanded in x around 0 94.6%
Final simplification92.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* a b) (- INFINITY))
t_1
(if (<= (* a b) 4e+114) (+ c (+ (* x y) (* 0.0625 (* z t)))) (+ c t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if ((a * b) <= -((double) INFINITY)) {
tmp = t_1;
} else if ((a * b) <= 4e+114) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if ((a * b) <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if ((a * b) <= 4e+114) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if (a * b) <= -math.inf: tmp = t_1 elif (a * b) <= 4e+114: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(a * b) <= Float64(-Inf)) tmp = t_1; elseif (Float64(a * b) <= 4e+114) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); tmp = 0.0; if ((a * b) <= -Inf) tmp = t_1; elseif ((a * b) <= 4e+114) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], (-Infinity)], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 4e+114], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+114}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -inf.0Initial program 83.3%
Taylor expanded in x around 0 91.7%
Taylor expanded in a around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
if -inf.0 < (*.f64 a b) < 4e114Initial program 100.0%
Taylor expanded in a around 0 91.0%
if 4e114 < (*.f64 a b) Initial program 90.3%
Taylor expanded in a around inf 74.8%
*-commutative74.8%
associate-*r*74.8%
Simplified74.8%
Final simplification89.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -5.5e+162) (and (not (<= z -6e+30)) (<= z -5.5e+30))) (* z (* t 0.0625)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5.5e+162) || (!(z <= -6e+30) && (z <= -5.5e+30))) {
tmp = z * (t * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-5.5d+162)) .or. (.not. (z <= (-6d+30))) .and. (z <= (-5.5d+30))) then
tmp = z * (t * 0.0625d0)
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5.5e+162) || (!(z <= -6e+30) && (z <= -5.5e+30))) {
tmp = z * (t * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -5.5e+162) or (not (z <= -6e+30) and (z <= -5.5e+30)): tmp = z * (t * 0.0625) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -5.5e+162) || (!(z <= -6e+30) && (z <= -5.5e+30))) tmp = Float64(z * Float64(t * 0.0625)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -5.5e+162) || (~((z <= -6e+30)) && (z <= -5.5e+30))) tmp = z * (t * 0.0625); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5.5e+162], And[N[Not[LessEqual[z, -6e+30]], $MachinePrecision], LessEqual[z, -5.5e+30]]], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+162} \lor \neg \left(z \leq -6 \cdot 10^{+30}\right) \land z \leq -5.5 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if z < -5.49999999999999966e162 or -5.99999999999999956e30 < z < -5.50000000000000025e30Initial program 94.3%
Taylor expanded in z around inf 97.1%
Taylor expanded in t around inf 71.9%
if -5.49999999999999966e162 < z < -5.99999999999999956e30 or -5.50000000000000025e30 < z Initial program 98.6%
Taylor expanded in x around inf 60.3%
Final simplification61.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= y -1.55e-35) (not (<= y 2.4e+23))) (+ 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 ((y <= -1.55e-35) || !(y <= 2.4e+23)) {
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 ((y <= (-1.55d-35)) .or. (.not. (y <= 2.4d+23))) 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 ((y <= -1.55e-35) || !(y <= 2.4e+23)) {
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 (y <= -1.55e-35) or not (y <= 2.4e+23): 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 ((y <= -1.55e-35) || !(y <= 2.4e+23)) 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 ((y <= -1.55e-35) || ~((y <= 2.4e+23))) 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[y, -1.55e-35], N[Not[LessEqual[y, 2.4e+23]], $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}\;y \leq -1.55 \cdot 10^{-35} \lor \neg \left(y \leq 2.4 \cdot 10^{+23}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if y < -1.55000000000000006e-35 or 2.4e23 < y Initial program 96.9%
Taylor expanded in x around inf 69.5%
if -1.55000000000000006e-35 < y < 2.4e23Initial program 99.2%
Taylor expanded in z around inf 66.9%
associate-*r*66.9%
*-commutative66.9%
associate-*r*66.9%
Simplified66.9%
Final simplification68.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 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 + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(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 26.6%
herbie shell --seed 2024105
(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))