
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
(if (<= t_1 INFINITY)
(+ c t_1)
(* b (- (+ (* 0.0625 (/ (* z t) b)) (/ c b)) (* a 0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = b * (((0.0625 * ((z * t) / b)) + (c / b)) - (a * 0.25));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = b * (((0.0625 * ((z * t) / b)) + (c / b)) - (a * 0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = b * (((0.0625 * ((z * t) / b)) + (c / b)) - (a * 0.25)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(b * Float64(Float64(Float64(0.0625 * Float64(Float64(z * t) / b)) + Float64(c / b)) - Float64(a * 0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = b * (((0.0625 * ((z * t) / b)) + (c / b)) - (a * 0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(b * N[(N[(N[(0.0625 * N[(N[(z * t), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(0.0625 \cdot \frac{z \cdot t}{b} + \frac{c}{b}\right) - a \cdot 0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in x around 0 62.5%
Taylor expanded in b around inf 87.5%
Final simplification99.6%
(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 96.8%
associate--l+96.8%
fma-define98.8%
associate-/l*98.8%
fma-neg98.8%
distribute-neg-frac298.8%
metadata-eval98.8%
Simplified98.8%
(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 96.8%
associate-+l-96.8%
*-commutative96.8%
associate-+l-96.8%
fma-define98.0%
*-commutative98.0%
associate-/l*98.0%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))))
(if (<= (* x y) -9.2e+80)
(* x y)
(if (<= (* x y) -5.1e-65)
t_1
(if (<= (* x y) 1.9e-221)
c
(if (<= (* x y) 1.85e+26)
(* a (* b -0.25))
(if (<= (* x y) 1.22e+119) 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) <= -9.2e+80) {
tmp = x * y;
} else if ((x * y) <= -5.1e-65) {
tmp = t_1;
} else if ((x * y) <= 1.9e-221) {
tmp = c;
} else if ((x * y) <= 1.85e+26) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 1.22e+119) {
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) <= (-9.2d+80)) then
tmp = x * y
else if ((x * y) <= (-5.1d-65)) then
tmp = t_1
else if ((x * y) <= 1.9d-221) then
tmp = c
else if ((x * y) <= 1.85d+26) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 1.22d+119) 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) <= -9.2e+80) {
tmp = x * y;
} else if ((x * y) <= -5.1e-65) {
tmp = t_1;
} else if ((x * y) <= 1.9e-221) {
tmp = c;
} else if ((x * y) <= 1.85e+26) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 1.22e+119) {
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) <= -9.2e+80: tmp = x * y elif (x * y) <= -5.1e-65: tmp = t_1 elif (x * y) <= 1.9e-221: tmp = c elif (x * y) <= 1.85e+26: tmp = a * (b * -0.25) elif (x * y) <= 1.22e+119: 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) <= -9.2e+80) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.1e-65) tmp = t_1; elseif (Float64(x * y) <= 1.9e-221) tmp = c; elseif (Float64(x * y) <= 1.85e+26) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 1.22e+119) 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) <= -9.2e+80) tmp = x * y; elseif ((x * y) <= -5.1e-65) tmp = t_1; elseif ((x * y) <= 1.9e-221) tmp = c; elseif ((x * y) <= 1.85e+26) tmp = a * (b * -0.25); elseif ((x * y) <= 1.22e+119) 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], -9.2e+80], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.1e-65], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.9e-221], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.85e+26], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.22e+119], 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 -9.2 \cdot 10^{+80}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.1 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{-221}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{+26}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 1.22 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.20000000000000016e80 or 1.2200000000000001e119 < (*.f64 x y) Initial program 92.2%
Taylor expanded in z around 0 83.9%
Taylor expanded in x around inf 67.6%
if -9.20000000000000016e80 < (*.f64 x y) < -5.10000000000000001e-65 or 1.84999999999999994e26 < (*.f64 x y) < 1.2200000000000001e119Initial program 98.1%
Taylor expanded in x around 0 88.0%
Taylor expanded in z around inf 75.5%
associate--l+75.5%
associate-*r/75.5%
div-sub75.6%
cancel-sign-sub-inv75.6%
metadata-eval75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in t around inf 49.8%
if -5.10000000000000001e-65 < (*.f64 x y) < 1.9e-221Initial program 100.0%
Taylor expanded in c around inf 47.1%
if 1.9e-221 < (*.f64 x y) < 1.84999999999999994e26Initial program 100.0%
Taylor expanded in z around 0 80.1%
Taylor expanded in a around inf 46.6%
*-commutative46.6%
associate-*r*46.6%
Simplified46.6%
Final simplification54.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625))))
(t_2 (* x (- y (* 0.25 (/ (* a b) x))))))
(if (<= (* x y) -5e+68)
t_2
(if (<= (* x y) 1e-261)
t_1
(if (<= (* x y) 2e+26)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 1e+119) 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 = x * (y - (0.25 * ((a * b) / x)));
double tmp;
if ((x * y) <= -5e+68) {
tmp = t_2;
} else if ((x * y) <= 1e-261) {
tmp = t_1;
} else if ((x * y) <= 2e+26) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = x * (y - (0.25d0 * ((a * b) / x)))
if ((x * y) <= (-5d+68)) then
tmp = t_2
else if ((x * y) <= 1d-261) then
tmp = t_1
else if ((x * y) <= 2d+26) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 1d+119) 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 = x * (y - (0.25 * ((a * b) / x)));
double tmp;
if ((x * y) <= -5e+68) {
tmp = t_2;
} else if ((x * y) <= 1e-261) {
tmp = t_1;
} else if ((x * y) <= 2e+26) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+119) {
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 = x * (y - (0.25 * ((a * b) / x))) tmp = 0 if (x * y) <= -5e+68: tmp = t_2 elif (x * y) <= 1e-261: tmp = t_1 elif (x * y) <= 2e+26: tmp = c + (a * (b * -0.25)) elif (x * y) <= 1e+119: 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(x * Float64(y - Float64(0.25 * Float64(Float64(a * b) / x)))) tmp = 0.0 if (Float64(x * y) <= -5e+68) tmp = t_2; elseif (Float64(x * y) <= 1e-261) tmp = t_1; elseif (Float64(x * y) <= 2e+26) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 1e+119) 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 = x * (y - (0.25 * ((a * b) / x))); tmp = 0.0; if ((x * y) <= -5e+68) tmp = t_2; elseif ((x * y) <= 1e-261) tmp = t_1; elseif ((x * y) <= 2e+26) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 1e+119) 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[(x * N[(y - N[(0.25 * N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+68], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e-261], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+26], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+119], 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 := x \cdot \left(y - 0.25 \cdot \frac{a \cdot b}{x}\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{-261}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+26}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000004e68 or 9.99999999999999944e118 < (*.f64 x y) Initial program 92.4%
Taylor expanded in z around inf 78.4%
Taylor expanded in t around 0 69.3%
Taylor expanded in x around inf 84.5%
Taylor expanded in c around 0 79.8%
if -5.0000000000000004e68 < (*.f64 x y) < 9.99999999999999984e-262 or 2.0000000000000001e26 < (*.f64 x y) < 9.99999999999999944e118Initial program 99.1%
Taylor expanded in z around inf 71.2%
associate-*r*71.2%
*-commutative71.2%
associate-*r*71.2%
Simplified71.2%
if 9.99999999999999984e-262 < (*.f64 x y) < 2.0000000000000001e26Initial program 100.0%
Taylor expanded in a around inf 78.6%
*-commutative78.6%
associate-*r*78.6%
Simplified78.6%
Final simplification75.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -5e+68)
t_2
(if (<= (* x y) 1e-261)
t_1
(if (<= (* x y) 2e+26)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 1e+119) 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 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -5e+68) {
tmp = t_2;
} else if ((x * y) <= 1e-261) {
tmp = t_1;
} else if ((x * y) <= 2e+26) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = (x * y) - ((a * b) * 0.25d0)
if ((x * y) <= (-5d+68)) then
tmp = t_2
else if ((x * y) <= 1d-261) then
tmp = t_1
else if ((x * y) <= 2d+26) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 1d+119) 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 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -5e+68) {
tmp = t_2;
} else if ((x * y) <= 1e-261) {
tmp = t_1;
} else if ((x * y) <= 2e+26) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+119) {
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 = (x * y) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -5e+68: tmp = t_2 elif (x * y) <= 1e-261: tmp = t_1 elif (x * y) <= 2e+26: tmp = c + (a * (b * -0.25)) elif (x * y) <= 1e+119: 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(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -5e+68) tmp = t_2; elseif (Float64(x * y) <= 1e-261) tmp = t_1; elseif (Float64(x * y) <= 2e+26) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 1e+119) 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 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -5e+68) tmp = t_2; elseif ((x * y) <= 1e-261) tmp = t_1; elseif ((x * y) <= 2e+26) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 1e+119) 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[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+68], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e-261], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+26], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+119], 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 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{-261}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+26}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000004e68 or 9.99999999999999944e118 < (*.f64 x y) Initial program 92.4%
Taylor expanded in z around 0 83.3%
Taylor expanded in c around 0 78.7%
if -5.0000000000000004e68 < (*.f64 x y) < 9.99999999999999984e-262 or 2.0000000000000001e26 < (*.f64 x y) < 9.99999999999999944e118Initial program 99.1%
Taylor expanded in z around inf 71.2%
associate-*r*71.2%
*-commutative71.2%
associate-*r*71.2%
Simplified71.2%
if 9.99999999999999984e-262 < (*.f64 x y) < 2.0000000000000001e26Initial program 100.0%
Taylor expanded in a around inf 78.6%
*-commutative78.6%
associate-*r*78.6%
Simplified78.6%
Final simplification75.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))))
(if (<= (* x y) -1e+81)
(+ c (* x y))
(if (<= (* x y) 1e-261)
t_1
(if (<= (* x y) 2e+26)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 1e+119) t_1 (* x y)))))))
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 tmp;
if ((x * y) <= -1e+81) {
tmp = c + (x * y);
} else if ((x * y) <= 1e-261) {
tmp = t_1;
} else if ((x * y) <= 2e+26) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+119) {
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 = c + (t * (z * 0.0625d0))
if ((x * y) <= (-1d+81)) then
tmp = c + (x * y)
else if ((x * y) <= 1d-261) then
tmp = t_1
else if ((x * y) <= 2d+26) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 1d+119) 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 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -1e+81) {
tmp = c + (x * y);
} else if ((x * y) <= 1e-261) {
tmp = t_1;
} else if ((x * y) <= 2e+26) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+119) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) tmp = 0 if (x * y) <= -1e+81: tmp = c + (x * y) elif (x * y) <= 1e-261: tmp = t_1 elif (x * y) <= 2e+26: tmp = c + (a * (b * -0.25)) elif (x * y) <= 1e+119: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) tmp = 0.0 if (Float64(x * y) <= -1e+81) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= 1e-261) tmp = t_1; elseif (Float64(x * y) <= 2e+26) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 1e+119) 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 = c + (t * (z * 0.0625)); tmp = 0.0; if ((x * y) <= -1e+81) tmp = c + (x * y); elseif ((x * y) <= 1e-261) tmp = t_1; elseif ((x * y) <= 2e+26) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 1e+119) 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[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+81], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-261], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+26], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+119], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+81}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 10^{-261}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+26}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999921e80Initial program 94.4%
Taylor expanded in x around inf 74.1%
if -9.99999999999999921e80 < (*.f64 x y) < 9.99999999999999984e-262 or 2.0000000000000001e26 < (*.f64 x y) < 9.99999999999999944e118Initial program 99.1%
Taylor expanded in z around inf 70.3%
associate-*r*70.3%
*-commutative70.3%
associate-*r*70.3%
Simplified70.3%
if 9.99999999999999984e-262 < (*.f64 x y) < 2.0000000000000001e26Initial program 100.0%
Taylor expanded in a around inf 78.6%
*-commutative78.6%
associate-*r*78.6%
Simplified78.6%
if 9.99999999999999944e118 < (*.f64 x y) Initial program 88.8%
Taylor expanded in z around 0 82.8%
Taylor expanded in x around inf 69.9%
Final simplification72.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* x y) -8.8e+101)
(* x y)
(if (<= (* x y) -3.5e-67)
t_1
(if (<= (* x y) 1.9e-220) c (if (<= (* x y) 4e+34) t_1 (* x y)))))))
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 ((x * y) <= -8.8e+101) {
tmp = x * y;
} else if ((x * y) <= -3.5e-67) {
tmp = t_1;
} else if ((x * y) <= 1.9e-220) {
tmp = c;
} else if ((x * y) <= 4e+34) {
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 = a * (b * (-0.25d0))
if ((x * y) <= (-8.8d+101)) then
tmp = x * y
else if ((x * y) <= (-3.5d-67)) then
tmp = t_1
else if ((x * y) <= 1.9d-220) then
tmp = c
else if ((x * y) <= 4d+34) 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 = a * (b * -0.25);
double tmp;
if ((x * y) <= -8.8e+101) {
tmp = x * y;
} else if ((x * y) <= -3.5e-67) {
tmp = t_1;
} else if ((x * y) <= 1.9e-220) {
tmp = c;
} else if ((x * y) <= 4e+34) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if (x * y) <= -8.8e+101: tmp = x * y elif (x * y) <= -3.5e-67: tmp = t_1 elif (x * y) <= 1.9e-220: tmp = c elif (x * y) <= 4e+34: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(x * y) <= -8.8e+101) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.5e-67) tmp = t_1; elseif (Float64(x * y) <= 1.9e-220) tmp = c; elseif (Float64(x * y) <= 4e+34) 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 = a * (b * -0.25); tmp = 0.0; if ((x * y) <= -8.8e+101) tmp = x * y; elseif ((x * y) <= -3.5e-67) tmp = t_1; elseif ((x * y) <= 1.9e-220) tmp = c; elseif ((x * y) <= 4e+34) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.8e+101], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-67], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.9e-220], c, If[LessEqual[N[(x * y), $MachinePrecision], 4e+34], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -8.8 \cdot 10^{+101}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{-220}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.8000000000000003e101 or 3.99999999999999978e34 < (*.f64 x y) Initial program 92.4%
Taylor expanded in z around 0 79.7%
Taylor expanded in x around inf 60.5%
if -8.8000000000000003e101 < (*.f64 x y) < -3.5e-67 or 1.90000000000000004e-220 < (*.f64 x y) < 3.99999999999999978e34Initial program 100.0%
Taylor expanded in z around 0 65.3%
Taylor expanded in a around inf 41.1%
*-commutative41.1%
associate-*r*41.1%
Simplified41.1%
if -3.5e-67 < (*.f64 x y) < 1.90000000000000004e-220Initial program 100.0%
Taylor expanded in c around inf 47.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -1e+81)
t_1
(if (<= (* x y) -2e-41)
(* z (* t 0.0625))
(if (<= (* x y) 1e+28) (+ c (* a (* b -0.25))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1e+81) {
tmp = t_1;
} else if ((x * y) <= -2e-41) {
tmp = z * (t * 0.0625);
} else if ((x * y) <= 1e+28) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-1d+81)) then
tmp = t_1
else if ((x * y) <= (-2d-41)) then
tmp = z * (t * 0.0625d0)
else if ((x * y) <= 1d+28) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1e+81) {
tmp = t_1;
} else if ((x * y) <= -2e-41) {
tmp = z * (t * 0.0625);
} else if ((x * y) <= 1e+28) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -1e+81: tmp = t_1 elif (x * y) <= -2e-41: tmp = z * (t * 0.0625) elif (x * y) <= 1e+28: tmp = c + (a * (b * -0.25)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+81) tmp = t_1; elseif (Float64(x * y) <= -2e-41) tmp = Float64(z * Float64(t * 0.0625)); elseif (Float64(x * y) <= 1e+28) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+81) tmp = t_1; elseif ((x * y) <= -2e-41) tmp = z * (t * 0.0625); elseif ((x * y) <= 1e+28) tmp = c + (a * (b * -0.25)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+81], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-41], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+28], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-41}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+28}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999921e80 or 9.99999999999999958e27 < (*.f64 x y) Initial program 92.8%
Taylor expanded in x around inf 67.6%
if -9.99999999999999921e80 < (*.f64 x y) < -2.00000000000000001e-41Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around inf 96.1%
associate--l+96.1%
associate-*r/96.1%
div-sub96.1%
cancel-sign-sub-inv96.1%
metadata-eval96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 66.2%
if -2.00000000000000001e-41 < (*.f64 x y) < 9.99999999999999958e27Initial program 100.0%
Taylor expanded in a around inf 72.0%
*-commutative72.0%
associate-*r*72.0%
Simplified72.0%
Final simplification69.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -1e+81)
(+ c (* x (+ y (/ (* a (* b -0.25)) x))))
(if (<= (* x y) 2e+26)
(- (+ c (* 0.0625 (* z t))) (* (* a b) 0.25))
(+ c (* 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) <= -1e+81) {
tmp = c + (x * (y + ((a * (b * -0.25)) / x)));
} else if ((x * y) <= 2e+26) {
tmp = (c + (0.0625 * (z * t))) - ((a * b) * 0.25);
} else {
tmp = c + (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) <= (-1d+81)) then
tmp = c + (x * (y + ((a * (b * (-0.25d0))) / x)))
else if ((x * y) <= 2d+26) then
tmp = (c + (0.0625d0 * (z * t))) - ((a * b) * 0.25d0)
else
tmp = c + (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) <= -1e+81) {
tmp = c + (x * (y + ((a * (b * -0.25)) / x)));
} else if ((x * y) <= 2e+26) {
tmp = (c + (0.0625 * (z * t))) - ((a * b) * 0.25);
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -1e+81: tmp = c + (x * (y + ((a * (b * -0.25)) / x))) elif (x * y) <= 2e+26: tmp = (c + (0.0625 * (z * t))) - ((a * b) * 0.25) else: tmp = c + (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) <= -1e+81) tmp = Float64(c + Float64(x * Float64(y + Float64(Float64(a * Float64(b * -0.25)) / x)))); elseif (Float64(x * y) <= 2e+26) tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + 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) <= -1e+81) tmp = c + (x * (y + ((a * (b * -0.25)) / x))); elseif ((x * y) <= 2e+26) tmp = (c + (0.0625 * (z * t))) - ((a * b) * 0.25); else tmp = c + (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], -1e+81], N[(c + N[(x * N[(y + N[(N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+26], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+81}:\\
\;\;\;\;c + x \cdot \left(y + \frac{a \cdot \left(b \cdot -0.25\right)}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+26}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999921e80Initial program 94.4%
Taylor expanded in z around inf 79.0%
Taylor expanded in t around 0 69.2%
Taylor expanded in x around inf 84.7%
associate-*r/84.7%
*-commutative84.7%
associate-*r*84.7%
Simplified84.7%
if -9.99999999999999921e80 < (*.f64 x y) < 2.0000000000000001e26Initial program 100.0%
Taylor expanded in x around 0 98.2%
if 2.0000000000000001e26 < (*.f64 x y) Initial program 91.6%
Taylor expanded in y around inf 94.9%
Taylor expanded in a around 0 84.8%
Final simplification92.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+112) (not (<= (* a b) 1e+15))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+112) || !((a * b) <= 1e+15)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-5d+112)) .or. (.not. ((a * b) <= 1d+15))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+112) || !((a * b) <= 1e+15)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+112) or not ((a * b) <= 1e+15): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+112) || !(Float64(a * b) <= 1e+15)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+112) || ~(((a * b) <= 1e+15))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+112], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+15]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+112} \lor \neg \left(a \cdot b \leq 10^{+15}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e112 or 1e15 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0 81.7%
if -5e112 < (*.f64 a b) < 1e15Initial program 99.3%
Taylor expanded in a around 0 95.4%
Final simplification89.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -1e+255)
(* x (- y (* 0.25 (/ (* a b) x))))
(if (<= (* a b) 5e+184)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+255) {
tmp = x * (y - (0.25 * ((a * b) / x)));
} else if ((a * b) <= 5e+184) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-1d+255)) then
tmp = x * (y - (0.25d0 * ((a * b) / x)))
else if ((a * b) <= 5d+184) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+255) {
tmp = x * (y - (0.25 * ((a * b) / x)));
} else if ((a * b) <= 5e+184) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+255: tmp = x * (y - (0.25 * ((a * b) / x))) elif (a * b) <= 5e+184: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+255) tmp = Float64(x * Float64(y - Float64(0.25 * Float64(Float64(a * b) / x)))); elseif (Float64(a * b) <= 5e+184) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -1e+255) tmp = x * (y - (0.25 * ((a * b) / x))); elseif ((a * b) <= 5e+184) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+255], N[(x * N[(y - N[(0.25 * N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+184], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+255}:\\
\;\;\;\;x \cdot \left(y - 0.25 \cdot \frac{a \cdot b}{x}\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+184}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999988e254Initial program 88.4%
Taylor expanded in z around inf 85.1%
Taylor expanded in t around 0 85.1%
Taylor expanded in x around inf 81.3%
Taylor expanded in c around 0 85.2%
if -9.99999999999999988e254 < (*.f64 a b) < 4.9999999999999999e184Initial program 98.9%
Taylor expanded in a around 0 88.3%
if 4.9999999999999999e184 < (*.f64 a b) Initial program 90.3%
Taylor expanded in z around 0 86.5%
Taylor expanded in c around 0 85.5%
Final simplification87.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= b -9e-25)
t_1
(if (<= b 5.2e+156)
(+ c (* x y))
(if (<= b 3.7e+226) (* 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 = a * (b * -0.25);
double tmp;
if (b <= -9e-25) {
tmp = t_1;
} else if (b <= 5.2e+156) {
tmp = c + (x * y);
} else if (b <= 3.7e+226) {
tmp = z * (t * 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 = a * (b * (-0.25d0))
if (b <= (-9d-25)) then
tmp = t_1
else if (b <= 5.2d+156) then
tmp = c + (x * y)
else if (b <= 3.7d+226) then
tmp = z * (t * 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 = a * (b * -0.25);
double tmp;
if (b <= -9e-25) {
tmp = t_1;
} else if (b <= 5.2e+156) {
tmp = c + (x * y);
} else if (b <= 3.7e+226) {
tmp = z * (t * 0.0625);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if b <= -9e-25: tmp = t_1 elif b <= 5.2e+156: tmp = c + (x * y) elif b <= 3.7e+226: tmp = z * (t * 0.0625) else: tmp = 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 (b <= -9e-25) tmp = t_1; elseif (b <= 5.2e+156) tmp = Float64(c + Float64(x * y)); elseif (b <= 3.7e+226) tmp = Float64(z * Float64(t * 0.0625)); else tmp = 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 (b <= -9e-25) tmp = t_1; elseif (b <= 5.2e+156) tmp = c + (x * y); elseif (b <= 3.7e+226) tmp = z * (t * 0.0625); else tmp = 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[b, -9e-25], t$95$1, If[LessEqual[b, 5.2e+156], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e+226], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -9 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+156}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{+226}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.0000000000000002e-25 or 3.69999999999999982e226 < b Initial program 97.0%
Taylor expanded in z around 0 81.2%
Taylor expanded in a around inf 42.5%
*-commutative42.5%
associate-*r*42.5%
Simplified42.5%
if -9.0000000000000002e-25 < b < 5.20000000000000037e156Initial program 98.5%
Taylor expanded in x around inf 60.8%
if 5.20000000000000037e156 < b < 3.69999999999999982e226Initial program 84.2%
Taylor expanded in x around 0 80.0%
Taylor expanded in z around inf 74.9%
associate--l+74.9%
associate-*r/74.9%
div-sub74.9%
cancel-sign-sub-inv74.9%
metadata-eval74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in t around inf 49.2%
Final simplification52.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.36e+45) (not (<= (* x y) 2.9e+48))) (* 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.36e+45) || !((x * y) <= 2.9e+48)) {
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.36d+45)) .or. (.not. ((x * y) <= 2.9d+48))) 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.36e+45) || !((x * y) <= 2.9e+48)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.36e+45) or not ((x * y) <= 2.9e+48): 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.36e+45) || !(Float64(x * y) <= 2.9e+48)) 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.36e+45) || ~(((x * y) <= 2.9e+48))) 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.36e+45], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.9e+48]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.36 \cdot 10^{+45} \lor \neg \left(x \cdot y \leq 2.9 \cdot 10^{+48}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.36e45 or 2.8999999999999999e48 < (*.f64 x y) Initial program 93.0%
Taylor expanded in z around 0 78.0%
Taylor expanded in x around inf 56.1%
if -1.36e45 < (*.f64 x y) < 2.8999999999999999e48Initial program 100.0%
Taylor expanded in c around inf 36.7%
Final simplification45.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.8%
Taylor expanded in c around inf 24.2%
herbie shell --seed 2024135
(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))