
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY) (+ (fma x y (fma z (* t 0.0625) (* b (* a -0.25)))) c) (* x (- y (* -0.0625 (* t (/ z x)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = fma(x, y, fma(z, (t * 0.0625), (b * (a * -0.25)))) + c;
} else {
tmp = x * (y - (-0.0625 * (t * (z / x))));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(fma(x, y, fma(z, Float64(t * 0.0625), Float64(b * Float64(a * -0.25)))) + c); else tmp = Float64(x * Float64(y - Float64(-0.0625 * Float64(t * Float64(z / x))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * N[(t * 0.0625), $MachinePrecision] + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision], N[(x * N[(y - N[(-0.0625 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t \cdot 0.0625, b \cdot \left(a \cdot -0.25\right)\right)\right) + c\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y - -0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\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%
associate--l+100.0%
Simplified100.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 a around 0 83.3%
Taylor expanded in c around 0 83.3%
Taylor expanded in x around -inf 100.0%
associate-*r*100.0%
mul-1-neg100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (+ c t_1)) (t_3 (+ c (* a (* b -0.25)))))
(if (<= (* x y) -8.5e+204)
(* x y)
(if (<= (* x y) -1.46e+184)
t_1
(if (<= (* x y) -2.2e+146)
(* x y)
(if (<= (* x y) -1.25e-144)
t_2
(if (<= (* x y) -3.8e-287)
t_3
(if (<= (* x y) 2e-147)
t_2
(if (<= (* x y) 6e+157) t_3 (* x y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = c + t_1;
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -8.5e+204) {
tmp = x * y;
} else if ((x * y) <= -1.46e+184) {
tmp = t_1;
} else if ((x * y) <= -2.2e+146) {
tmp = x * y;
} else if ((x * y) <= -1.25e-144) {
tmp = t_2;
} else if ((x * y) <= -3.8e-287) {
tmp = t_3;
} else if ((x * y) <= 2e-147) {
tmp = t_2;
} else if ((x * y) <= 6e+157) {
tmp = t_3;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = c + t_1
t_3 = c + (a * (b * (-0.25d0)))
if ((x * y) <= (-8.5d+204)) then
tmp = x * y
else if ((x * y) <= (-1.46d+184)) then
tmp = t_1
else if ((x * y) <= (-2.2d+146)) then
tmp = x * y
else if ((x * y) <= (-1.25d-144)) then
tmp = t_2
else if ((x * y) <= (-3.8d-287)) then
tmp = t_3
else if ((x * y) <= 2d-147) then
tmp = t_2
else if ((x * y) <= 6d+157) then
tmp = t_3
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = c + t_1;
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -8.5e+204) {
tmp = x * y;
} else if ((x * y) <= -1.46e+184) {
tmp = t_1;
} else if ((x * y) <= -2.2e+146) {
tmp = x * y;
} else if ((x * y) <= -1.25e-144) {
tmp = t_2;
} else if ((x * y) <= -3.8e-287) {
tmp = t_3;
} else if ((x * y) <= 2e-147) {
tmp = t_2;
} else if ((x * y) <= 6e+157) {
tmp = t_3;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = c + t_1 t_3 = c + (a * (b * -0.25)) tmp = 0 if (x * y) <= -8.5e+204: tmp = x * y elif (x * y) <= -1.46e+184: tmp = t_1 elif (x * y) <= -2.2e+146: tmp = x * y elif (x * y) <= -1.25e-144: tmp = t_2 elif (x * y) <= -3.8e-287: tmp = t_3 elif (x * y) <= 2e-147: tmp = t_2 elif (x * y) <= 6e+157: tmp = t_3 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(c + t_1) t_3 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(x * y) <= -8.5e+204) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.46e+184) tmp = t_1; elseif (Float64(x * y) <= -2.2e+146) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.25e-144) tmp = t_2; elseif (Float64(x * y) <= -3.8e-287) tmp = t_3; elseif (Float64(x * y) <= 2e-147) tmp = t_2; elseif (Float64(x * y) <= 6e+157) tmp = t_3; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = c + t_1; t_3 = c + (a * (b * -0.25)); tmp = 0.0; if ((x * y) <= -8.5e+204) tmp = x * y; elseif ((x * y) <= -1.46e+184) tmp = t_1; elseif ((x * y) <= -2.2e+146) tmp = x * y; elseif ((x * y) <= -1.25e-144) tmp = t_2; elseif ((x * y) <= -3.8e-287) tmp = t_3; elseif ((x * y) <= 2e-147) tmp = t_2; elseif ((x * y) <= 6e+157) tmp = t_3; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+204], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.46e+184], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.2e+146], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.25e-144], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.8e-287], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 2e-147], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6e+157], t$95$3, N[(x * y), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := c + t\_1\\
t_3 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+204}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.46 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{+146}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.25 \cdot 10^{-144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-287}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+157}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.5e204 or -1.46e184 < (*.f64 x y) < -2.1999999999999998e146 or 6.00000000000000021e157 < (*.f64 x y) Initial program 94.6%
Taylor expanded in x around inf 85.3%
if -8.5e204 < (*.f64 x y) < -1.46e184Initial program 100.0%
Taylor expanded in z around inf 100.0%
if -2.1999999999999998e146 < (*.f64 x y) < -1.2499999999999999e-144 or -3.79999999999999982e-287 < (*.f64 x y) < 1.9999999999999999e-147Initial program 98.1%
Taylor expanded in z around inf 68.2%
if -1.2499999999999999e-144 < (*.f64 x y) < -3.79999999999999982e-287 or 1.9999999999999999e-147 < (*.f64 x y) < 6.00000000000000021e157Initial program 100.0%
Taylor expanded in a around inf 68.9%
metadata-eval68.9%
distribute-lft-neg-in68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
metadata-eval68.9%
Simplified68.9%
Final simplification74.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25))))
(t_2 (* 0.0625 (* z t)))
(t_3 (+ c t_2))
(t_4 (+ (* x y) t_2)))
(if (<= (* x y) -1e+144)
t_4
(if (<= (* x y) -1e-144)
t_3
(if (<= (* x y) -5e-287)
t_1
(if (<= (* x y) 2e-158) t_3 (if (<= (* x y) 5e+156) t_1 t_4)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = 0.0625 * (z * t);
double t_3 = c + t_2;
double t_4 = (x * y) + t_2;
double tmp;
if ((x * y) <= -1e+144) {
tmp = t_4;
} else if ((x * y) <= -1e-144) {
tmp = t_3;
} else if ((x * y) <= -5e-287) {
tmp = t_1;
} else if ((x * y) <= 2e-158) {
tmp = t_3;
} else if ((x * y) <= 5e+156) {
tmp = t_1;
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = 0.0625d0 * (z * t)
t_3 = c + t_2
t_4 = (x * y) + t_2
if ((x * y) <= (-1d+144)) then
tmp = t_4
else if ((x * y) <= (-1d-144)) then
tmp = t_3
else if ((x * y) <= (-5d-287)) then
tmp = t_1
else if ((x * y) <= 2d-158) then
tmp = t_3
else if ((x * y) <= 5d+156) then
tmp = t_1
else
tmp = t_4
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 + (a * (b * -0.25));
double t_2 = 0.0625 * (z * t);
double t_3 = c + t_2;
double t_4 = (x * y) + t_2;
double tmp;
if ((x * y) <= -1e+144) {
tmp = t_4;
} else if ((x * y) <= -1e-144) {
tmp = t_3;
} else if ((x * y) <= -5e-287) {
tmp = t_1;
} else if ((x * y) <= 2e-158) {
tmp = t_3;
} else if ((x * y) <= 5e+156) {
tmp = t_1;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = 0.0625 * (z * t) t_3 = c + t_2 t_4 = (x * y) + t_2 tmp = 0 if (x * y) <= -1e+144: tmp = t_4 elif (x * y) <= -1e-144: tmp = t_3 elif (x * y) <= -5e-287: tmp = t_1 elif (x * y) <= 2e-158: tmp = t_3 elif (x * y) <= 5e+156: tmp = t_1 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(0.0625 * Float64(z * t)) t_3 = Float64(c + t_2) t_4 = Float64(Float64(x * y) + t_2) tmp = 0.0 if (Float64(x * y) <= -1e+144) tmp = t_4; elseif (Float64(x * y) <= -1e-144) tmp = t_3; elseif (Float64(x * y) <= -5e-287) tmp = t_1; elseif (Float64(x * y) <= 2e-158) tmp = t_3; elseif (Float64(x * y) <= 5e+156) tmp = t_1; else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = 0.0625 * (z * t); t_3 = c + t_2; t_4 = (x * y) + t_2; tmp = 0.0; if ((x * y) <= -1e+144) tmp = t_4; elseif ((x * y) <= -1e-144) tmp = t_3; elseif ((x * y) <= -5e-287) tmp = t_1; elseif ((x * y) <= 2e-158) tmp = t_3; elseif ((x * y) <= 5e+156) tmp = t_1; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+144], t$95$4, If[LessEqual[N[(x * y), $MachinePrecision], -1e-144], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -5e-287], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-158], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 5e+156], t$95$1, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := c + t\_2\\
t_4 := x \cdot y + t\_2\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+144}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-144}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-158}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000002e144 or 4.99999999999999992e156 < (*.f64 x y) Initial program 95.0%
Taylor expanded in a around 0 91.7%
Taylor expanded in c around 0 91.7%
if -1.00000000000000002e144 < (*.f64 x y) < -9.9999999999999995e-145 or -5.00000000000000025e-287 < (*.f64 x y) < 2.00000000000000013e-158Initial program 98.0%
Taylor expanded in z around inf 68.5%
if -9.9999999999999995e-145 < (*.f64 x y) < -5.00000000000000025e-287 or 2.00000000000000013e-158 < (*.f64 x y) < 4.99999999999999992e156Initial program 100.0%
Taylor expanded in a around inf 68.9%
metadata-eval68.9%
distribute-lft-neg-in68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
metadata-eval68.9%
Simplified68.9%
Final simplification76.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -8.5e+204)
(* x y)
(if (<= (* x y) -1.45e+184)
t_1
(if (<= (* x y) -2.95e+54)
(* x y)
(if (<= (* x y) -3.6e-146)
t_1
(if (<= (* x y) 8.4e+130) (* (* a b) -0.25) (* x y))))))))
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) <= -8.5e+204) {
tmp = x * y;
} else if ((x * y) <= -1.45e+184) {
tmp = t_1;
} else if ((x * y) <= -2.95e+54) {
tmp = x * y;
} else if ((x * y) <= -3.6e-146) {
tmp = t_1;
} else if ((x * y) <= 8.4e+130) {
tmp = (a * b) * -0.25;
} 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 = 0.0625d0 * (z * t)
if ((x * y) <= (-8.5d+204)) then
tmp = x * y
else if ((x * y) <= (-1.45d+184)) then
tmp = t_1
else if ((x * y) <= (-2.95d+54)) then
tmp = x * y
else if ((x * y) <= (-3.6d-146)) then
tmp = t_1
else if ((x * y) <= 8.4d+130) then
tmp = (a * b) * (-0.25d0)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -8.5e+204) {
tmp = x * y;
} else if ((x * y) <= -1.45e+184) {
tmp = t_1;
} else if ((x * y) <= -2.95e+54) {
tmp = x * y;
} else if ((x * y) <= -3.6e-146) {
tmp = t_1;
} else if ((x * y) <= 8.4e+130) {
tmp = (a * b) * -0.25;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -8.5e+204: tmp = x * y elif (x * y) <= -1.45e+184: tmp = t_1 elif (x * y) <= -2.95e+54: tmp = x * y elif (x * y) <= -3.6e-146: tmp = t_1 elif (x * y) <= 8.4e+130: tmp = (a * b) * -0.25 else: tmp = x * y 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) <= -8.5e+204) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.45e+184) tmp = t_1; elseif (Float64(x * y) <= -2.95e+54) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.6e-146) tmp = t_1; elseif (Float64(x * y) <= 8.4e+130) tmp = Float64(Float64(a * b) * -0.25); else tmp = Float64(x * y); 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) <= -8.5e+204) tmp = x * y; elseif ((x * y) <= -1.45e+184) tmp = t_1; elseif ((x * y) <= -2.95e+54) tmp = x * y; elseif ((x * y) <= -3.6e-146) tmp = t_1; elseif ((x * y) <= 8.4e+130) tmp = (a * b) * -0.25; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+204], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.45e+184], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.95e+54], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.6e-146], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.4e+130], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+204}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.95 \cdot 10^{+54}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.6 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 8.4 \cdot 10^{+130}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.5e204 or -1.4499999999999999e184 < (*.f64 x y) < -2.9499999999999999e54 or 8.39999999999999962e130 < (*.f64 x y) Initial program 94.5%
Taylor expanded in x around inf 72.6%
if -8.5e204 < (*.f64 x y) < -1.4499999999999999e184 or -2.9499999999999999e54 < (*.f64 x y) < -3.59999999999999978e-146Initial program 100.0%
Taylor expanded in z around inf 53.9%
if -3.59999999999999978e-146 < (*.f64 x y) < 8.39999999999999962e130Initial program 99.1%
Taylor expanded in a around inf 39.5%
Final simplification53.8%
(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) (+ t_1 c) (* x (- y (* -0.0625 (* t (/ z x))))))))
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 = t_1 + c;
} else {
tmp = x * (y - (-0.0625 * (t * (z / x))));
}
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 = t_1 + c;
} else {
tmp = x * (y - (-0.0625 * (t * (z / x))));
}
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 = t_1 + c else: tmp = x * (y - (-0.0625 * (t * (z / x)))) 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(t_1 + c); else tmp = Float64(x * Float64(y - Float64(-0.0625 * Float64(t * Float64(z / x))))); 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 = t_1 + c; else tmp = x * (y - (-0.0625 * (t * (z / x)))); 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[(t$95$1 + c), $MachinePrecision], N[(x * N[(y - N[(-0.0625 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $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:\\
\;\;\;\;t\_1 + c\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y - -0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\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 a around 0 83.3%
Taylor expanded in c around 0 83.3%
Taylor expanded in x around -inf 100.0%
associate-*r*100.0%
mul-1-neg100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -9.4e+204)
(* x y)
(if (<= (* x y) -4.8e+183)
t_1
(if (or (<= (* x y) -3.3e+146) (not (<= (* x y) 4.8e+158)))
(* x y)
(+ c t_1))))))
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) <= -9.4e+204) {
tmp = x * y;
} else if ((x * y) <= -4.8e+183) {
tmp = t_1;
} else if (((x * y) <= -3.3e+146) || !((x * y) <= 4.8e+158)) {
tmp = x * y;
} else {
tmp = c + 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 = 0.0625d0 * (z * t)
if ((x * y) <= (-9.4d+204)) then
tmp = x * y
else if ((x * y) <= (-4.8d+183)) then
tmp = t_1
else if (((x * y) <= (-3.3d+146)) .or. (.not. ((x * y) <= 4.8d+158))) then
tmp = x * y
else
tmp = c + 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 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -9.4e+204) {
tmp = x * y;
} else if ((x * y) <= -4.8e+183) {
tmp = t_1;
} else if (((x * y) <= -3.3e+146) || !((x * y) <= 4.8e+158)) {
tmp = x * y;
} else {
tmp = c + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -9.4e+204: tmp = x * y elif (x * y) <= -4.8e+183: tmp = t_1 elif ((x * y) <= -3.3e+146) or not ((x * y) <= 4.8e+158): tmp = x * y else: tmp = c + t_1 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) <= -9.4e+204) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.8e+183) tmp = t_1; elseif ((Float64(x * y) <= -3.3e+146) || !(Float64(x * y) <= 4.8e+158)) tmp = Float64(x * y); else tmp = Float64(c + t_1); 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) <= -9.4e+204) tmp = x * y; elseif ((x * y) <= -4.8e+183) tmp = t_1; elseif (((x * y) <= -3.3e+146) || ~(((x * y) <= 4.8e+158))) tmp = x * y; else tmp = c + t_1; 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[LessEqual[N[(x * y), $MachinePrecision], -9.4e+204], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.8e+183], t$95$1, If[Or[LessEqual[N[(x * y), $MachinePrecision], -3.3e+146], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.8e+158]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(c + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -9.4 \cdot 10^{+204}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+146} \lor \neg \left(x \cdot y \leq 4.8 \cdot 10^{+158}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -9.4000000000000003e204 or -4.8000000000000003e183 < (*.f64 x y) < -3.30000000000000016e146 or 4.80000000000000016e158 < (*.f64 x y) Initial program 94.6%
Taylor expanded in x around inf 85.3%
if -9.4000000000000003e204 < (*.f64 x y) < -4.8000000000000003e183Initial program 100.0%
Taylor expanded in z around inf 100.0%
if -3.30000000000000016e146 < (*.f64 x y) < 4.80000000000000016e158Initial program 98.8%
Taylor expanded in z around inf 61.6%
Final simplification69.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -2e+71)
(+ c (+ (* x y) t_1))
(if (<= (* x y) 5e+156)
(- (+ c t_1) (* (* a b) 0.25))
(* x (- y (* -0.0625 (* t (/ z x)))))))))
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+71) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 5e+156) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = x * (y - (-0.0625 * (t * (z / x))));
}
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+71)) then
tmp = c + ((x * y) + t_1)
else if ((x * y) <= 5d+156) then
tmp = (c + t_1) - ((a * b) * 0.25d0)
else
tmp = x * (y - ((-0.0625d0) * (t * (z / x))))
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+71) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 5e+156) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = x * (y - (-0.0625 * (t * (z / x))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -2e+71: tmp = c + ((x * y) + t_1) elif (x * y) <= 5e+156: tmp = (c + t_1) - ((a * b) * 0.25) else: tmp = x * (y - (-0.0625 * (t * (z / x)))) 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+71) tmp = Float64(c + Float64(Float64(x * y) + t_1)); elseif (Float64(x * y) <= 5e+156) tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(x * Float64(y - Float64(-0.0625 * Float64(t * Float64(z / x))))); 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+71) tmp = c + ((x * y) + t_1); elseif ((x * y) <= 5e+156) tmp = (c + t_1) - ((a * b) * 0.25); else tmp = x * (y - (-0.0625 * (t * (z / x)))); 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[LessEqual[N[(x * y), $MachinePrecision], -2e+71], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+156], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(x * N[(y - N[(-0.0625 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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^{+71}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+156}:\\
\;\;\;\;\left(c + t\_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y - -0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e71Initial program 95.9%
Taylor expanded in a around 0 92.3%
if -2.0000000000000001e71 < (*.f64 x y) < 4.99999999999999992e156Initial program 99.4%
Taylor expanded in x around 0 94.8%
if 4.99999999999999992e156 < (*.f64 x y) Initial program 93.0%
Taylor expanded in a around 0 88.8%
Taylor expanded in c around 0 88.8%
Taylor expanded in x around -inf 91.1%
associate-*r*91.1%
mul-1-neg91.1%
neg-mul-191.1%
+-commutative91.1%
unsub-neg91.1%
associate-/l*91.1%
Simplified91.1%
Final simplification93.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+132) (not (<= (* a b) 2e+147))) (- (* 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+132) || !((a * b) <= 2e+147)) {
tmp = (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+132)) .or. (.not. ((a * b) <= 2d+147))) then
tmp = (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+132) || !((a * b) <= 2e+147)) {
tmp = (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+132) or not ((a * b) <= 2e+147): tmp = (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+132) || !(Float64(a * b) <= 2e+147)) tmp = Float64(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+132) || ~(((a * b) <= 2e+147))) tmp = (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+132], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+147]], $MachinePrecision]], N[(N[(x * y), $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^{+132} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+147}\right):\\
\;\;\;\;x \cdot y - \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) < -5.0000000000000001e132 or 2e147 < (*.f64 a b) Initial program 93.1%
Taylor expanded in z around 0 81.1%
Taylor expanded in c around 0 78.9%
if -5.0000000000000001e132 < (*.f64 a b) < 2e147Initial program 100.0%
Taylor expanded in a around 0 94.1%
Final simplification88.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+76)
(- (+ (* x y) c) t_1)
(if (<= (* a b) 5e+148) (+ c (+ (* x y) t_2)) (- t_2 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 t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+76) {
tmp = ((x * y) + c) - t_1;
} else if ((a * b) <= 5e+148) {
tmp = c + ((x * y) + t_2);
} else {
tmp = t_2 - 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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+76)) then
tmp = ((x * y) + c) - t_1
else if ((a * b) <= 5d+148) then
tmp = c + ((x * y) + t_2)
else
tmp = t_2 - 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 t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+76) {
tmp = ((x * y) + c) - t_1;
} else if ((a * b) <= 5e+148) {
tmp = c + ((x * y) + t_2);
} else {
tmp = t_2 - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+76: tmp = ((x * y) + c) - t_1 elif (a * b) <= 5e+148: tmp = c + ((x * y) + t_2) else: tmp = t_2 - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+76) tmp = Float64(Float64(Float64(x * y) + c) - t_1); elseif (Float64(a * b) <= 5e+148) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(t_2 - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+76) tmp = ((x * y) + c) - t_1; elseif ((a * b) <= 5e+148) tmp = c + ((x * y) + t_2); else tmp = t_2 - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+76], N[(N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+148], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+76}:\\
\;\;\;\;\left(x \cdot y + c\right) - t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+148}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999991e76Initial program 93.2%
Taylor expanded in z around 0 79.0%
if -4.99999999999999991e76 < (*.f64 a b) < 5.00000000000000024e148Initial program 100.0%
Taylor expanded in a around 0 95.1%
if 5.00000000000000024e148 < (*.f64 a b) Initial program 94.2%
Taylor expanded in x around 0 86.6%
Taylor expanded in c around 0 84.8%
Final simplification90.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+132)
(- (* x y) t_1)
(if (<= (* a b) 5e+148) (+ c (+ (* x y) t_2)) (- t_2 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 t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+132) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 5e+148) {
tmp = c + ((x * y) + t_2);
} else {
tmp = t_2 - 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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+132)) then
tmp = (x * y) - t_1
else if ((a * b) <= 5d+148) then
tmp = c + ((x * y) + t_2)
else
tmp = t_2 - 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 t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+132) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 5e+148) {
tmp = c + ((x * y) + t_2);
} else {
tmp = t_2 - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+132: tmp = (x * y) - t_1 elif (a * b) <= 5e+148: tmp = c + ((x * y) + t_2) else: tmp = t_2 - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+132) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 5e+148) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(t_2 - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+132) tmp = (x * y) - t_1; elseif ((a * b) <= 5e+148) tmp = c + ((x * y) + t_2); else tmp = t_2 - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+132], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+148], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+132}:\\
\;\;\;\;x \cdot y - t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+148}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000001e132Initial program 91.4%
Taylor expanded in z around 0 78.1%
Taylor expanded in c around 0 75.2%
if -5.0000000000000001e132 < (*.f64 a b) < 5.00000000000000024e148Initial program 100.0%
Taylor expanded in a around 0 94.1%
if 5.00000000000000024e148 < (*.f64 a b) Initial program 94.2%
Taylor expanded in x around 0 86.6%
Taylor expanded in c around 0 84.8%
Final simplification89.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.1e+70) (not (<= (* x y) 4.5e+129))) (* 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 (((x * y) <= -2.1e+70) || !((x * y) <= 4.5e+129)) {
tmp = x * y;
} else {
tmp = (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 (((x * y) <= (-2.1d+70)) .or. (.not. ((x * y) <= 4.5d+129))) then
tmp = x * y
else
tmp = (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 (((x * y) <= -2.1e+70) || !((x * y) <= 4.5e+129)) {
tmp = x * y;
} else {
tmp = (a * b) * -0.25;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.1e+70) or not ((x * y) <= 4.5e+129): tmp = x * y else: tmp = (a * b) * -0.25 return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.1e+70) || !(Float64(x * y) <= 4.5e+129)) tmp = Float64(x * y); else tmp = 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 (((x * y) <= -2.1e+70) || ~(((x * y) <= 4.5e+129))) tmp = x * y; else tmp = (a * b) * -0.25; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.1e+70], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.5e+129]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+70} \lor \neg \left(x \cdot y \leq 4.5 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -2.10000000000000008e70 or 4.5000000000000001e129 < (*.f64 x y) Initial program 94.7%
Taylor expanded in x around inf 70.4%
if -2.10000000000000008e70 < (*.f64 x y) < 4.5000000000000001e129Initial program 99.3%
Taylor expanded in a around inf 36.1%
Final simplification48.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.02e+145) (not (<= (* x y) 5.2e+84))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.02e+145) || !((x * y) <= 5.2e+84)) {
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) <= (-2.02d+145)) .or. (.not. ((x * y) <= 5.2d+84))) 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) <= -2.02e+145) || !((x * y) <= 5.2e+84)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.02e+145) or not ((x * y) <= 5.2e+84): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.02e+145) || !(Float64(x * y) <= 5.2e+84)) 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) <= -2.02e+145) || ~(((x * y) <= 5.2e+84))) 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], -2.02e+145], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.2e+84]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.02 \cdot 10^{+145} \lor \neg \left(x \cdot y \leq 5.2 \cdot 10^{+84}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.01999999999999996e145 or 5.2000000000000002e84 < (*.f64 x y) Initial program 95.7%
Taylor expanded in x around inf 71.0%
if -2.01999999999999996e145 < (*.f64 x y) < 5.2000000000000002e84Initial program 98.7%
Taylor expanded in c around inf 29.7%
Final simplification44.9%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.6%
Taylor expanded in c around inf 20.7%
herbie shell --seed 2024097
(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))