
(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 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 96.5%
associate-+l-96.5%
associate--l+96.5%
fma-def97.7%
associate-*l/97.7%
fma-neg98.9%
sub-neg98.9%
distribute-neg-in98.9%
remove-double-neg98.9%
associate-/l*99.2%
distribute-frac-neg99.2%
associate-/r/99.2%
fma-def99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (* (/ z 16.0) t)) (+ c (/ a (/ -4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, ((z / 16.0) * t)) + (c + (a / (-4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(Float64(z / 16.0) * t)) + Float64(c + Float64(a / Float64(-4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(c + \frac{a}{\frac{-4}{b}}\right)
\end{array}
Initial program 96.5%
sub-neg96.5%
associate-+l+96.5%
fma-def97.3%
associate-*l/97.3%
distribute-frac-neg97.3%
distribute-rgt-neg-out97.3%
associate-/l*97.6%
neg-mul-197.6%
associate-/r*97.6%
metadata-eval97.6%
Simplified97.6%
Final simplification97.6%
(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) (* a (* b -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 = a * (b * -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 = a * (b * -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 = a * (b * -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(a * Float64(b * -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 = a * (b * -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[(a * N[(b * -0.25), $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}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in z around 0 37.5%
Taylor expanded in a around inf 62.7%
*-commutative62.7%
associate-*r*62.7%
Simplified62.7%
Final simplification98.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25))
(t_2 (* 0.0625 (* z t)))
(t_3 (+ c (+ (* x y) t_2))))
(if (<= (* a b) -5e+117)
(- (* x y) t_1)
(if (<= (* a b) 5e+79)
t_3
(if (<= (* a b) 1e+187)
(- t_2 t_1)
(if (<= (* a b) 5e+275) t_3 (* a (* b -0.25))))))))
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 t_3 = c + ((x * y) + t_2);
double tmp;
if ((a * b) <= -5e+117) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 5e+79) {
tmp = t_3;
} else if ((a * b) <= 1e+187) {
tmp = t_2 - t_1;
} else if ((a * b) <= 5e+275) {
tmp = t_3;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
t_3 = c + ((x * y) + t_2)
if ((a * b) <= (-5d+117)) then
tmp = (x * y) - t_1
else if ((a * b) <= 5d+79) then
tmp = t_3
else if ((a * b) <= 1d+187) then
tmp = t_2 - t_1
else if ((a * b) <= 5d+275) then
tmp = t_3
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 t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double t_3 = c + ((x * y) + t_2);
double tmp;
if ((a * b) <= -5e+117) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 5e+79) {
tmp = t_3;
} else if ((a * b) <= 1e+187) {
tmp = t_2 - t_1;
} else if ((a * b) <= 5e+275) {
tmp = t_3;
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) t_3 = c + ((x * y) + t_2) tmp = 0 if (a * b) <= -5e+117: tmp = (x * y) - t_1 elif (a * b) <= 5e+79: tmp = t_3 elif (a * b) <= 1e+187: tmp = t_2 - t_1 elif (a * b) <= 5e+275: tmp = t_3 else: tmp = a * (b * -0.25) 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)) t_3 = Float64(c + Float64(Float64(x * y) + t_2)) tmp = 0.0 if (Float64(a * b) <= -5e+117) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 5e+79) tmp = t_3; elseif (Float64(a * b) <= 1e+187) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 5e+275) tmp = t_3; else tmp = Float64(a * Float64(b * -0.25)); 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); t_3 = c + ((x * y) + t_2); tmp = 0.0; if ((a * b) <= -5e+117) tmp = (x * y) - t_1; elseif ((a * b) <= 5e+79) tmp = t_3; elseif ((a * b) <= 1e+187) tmp = t_2 - t_1; elseif ((a * b) <= 5e+275) tmp = t_3; else tmp = a * (b * -0.25); 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]}, Block[{t$95$3 = N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+117], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+79], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 1e+187], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+275], t$95$3, N[(a * N[(b * -0.25), $MachinePrecision]), $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)\\
t_3 := c + \left(x \cdot y + t_2\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+117}:\\
\;\;\;\;x \cdot y - t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+79}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 10^{+187}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+275}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999983e117Initial program 90.0%
Taylor expanded in z around 0 85.7%
Taylor expanded in c around 0 83.3%
if -4.99999999999999983e117 < (*.f64 a b) < 5e79 or 9.99999999999999907e186 < (*.f64 a b) < 5.0000000000000003e275Initial program 99.4%
Taylor expanded in a around 0 90.6%
if 5e79 < (*.f64 a b) < 9.99999999999999907e186Initial program 100.0%
Taylor expanded in x around 0 93.8%
Taylor expanded in c around 0 92.4%
if 5.0000000000000003e275 < (*.f64 a b) Initial program 83.4%
Taylor expanded in z around 0 87.7%
Taylor expanded in a around inf 92.1%
*-commutative92.1%
associate-*r*95.7%
Simplified95.7%
Final simplification90.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* z t)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -3.7e+55)
t_2
(if (<= (* x y) 6e-298)
t_1
(if (<= (* x y) 6.6e-242)
(* a (* b -0.25))
(if (<= (* x y) 6e+29) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -3.7e+55) {
tmp = t_2;
} else if ((x * y) <= 6e-298) {
tmp = t_1;
} else if ((x * y) <= 6.6e-242) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 6e+29) {
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 + (0.0625d0 * (z * t))
t_2 = c + (x * y)
if ((x * y) <= (-3.7d+55)) then
tmp = t_2
else if ((x * y) <= 6d-298) then
tmp = t_1
else if ((x * y) <= 6.6d-242) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 6d+29) 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 + (0.0625 * (z * t));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -3.7e+55) {
tmp = t_2;
} else if ((x * y) <= 6e-298) {
tmp = t_1;
} else if ((x * y) <= 6.6e-242) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 6e+29) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (z * t)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -3.7e+55: tmp = t_2 elif (x * y) <= 6e-298: tmp = t_1 elif (x * y) <= 6.6e-242: tmp = a * (b * -0.25) elif (x * y) <= 6e+29: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(z * t))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.7e+55) tmp = t_2; elseif (Float64(x * y) <= 6e-298) tmp = t_1; elseif (Float64(x * y) <= 6.6e-242) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 6e+29) 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 + (0.0625 * (z * t)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -3.7e+55) tmp = t_2; elseif ((x * y) <= 6e-298) tmp = t_1; elseif ((x * y) <= 6.6e-242) tmp = a * (b * -0.25); elseif ((x * y) <= 6e+29) 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.7e+55], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6e-298], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.6e-242], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6e+29], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -3.7 \cdot 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-242}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -3.7000000000000002e55 or 5.9999999999999998e29 < (*.f64 x y) Initial program 95.0%
Taylor expanded in x around inf 67.3%
if -3.7000000000000002e55 < (*.f64 x y) < 5.9999999999999999e-298 or 6.59999999999999963e-242 < (*.f64 x y) < 5.9999999999999998e29Initial program 97.7%
Taylor expanded in z around inf 61.6%
if 5.9999999999999999e-298 < (*.f64 x y) < 6.59999999999999963e-242Initial program 100.0%
Taylor expanded in z around 0 82.0%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
associate-*r*73.6%
Simplified73.6%
Final simplification64.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25))
(t_2 (* 0.0625 (* z t)))
(t_3 (- (+ c (* x y)) t_1)))
(if (<= (* a b) -5e+117)
t_3
(if (<= (* a b) 5e+79)
(+ c (+ (* x y) t_2))
(if (<= (* a b) 1e+170) (- t_2 t_1) t_3)))))
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 t_3 = (c + (x * y)) - t_1;
double tmp;
if ((a * b) <= -5e+117) {
tmp = t_3;
} else if ((a * b) <= 5e+79) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 1e+170) {
tmp = t_2 - t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
t_3 = (c + (x * y)) - t_1
if ((a * b) <= (-5d+117)) then
tmp = t_3
else if ((a * b) <= 5d+79) then
tmp = c + ((x * y) + t_2)
else if ((a * b) <= 1d+170) then
tmp = t_2 - t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double t_3 = (c + (x * y)) - t_1;
double tmp;
if ((a * b) <= -5e+117) {
tmp = t_3;
} else if ((a * b) <= 5e+79) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 1e+170) {
tmp = t_2 - t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) t_3 = (c + (x * y)) - t_1 tmp = 0 if (a * b) <= -5e+117: tmp = t_3 elif (a * b) <= 5e+79: tmp = c + ((x * y) + t_2) elif (a * b) <= 1e+170: tmp = t_2 - t_1 else: tmp = t_3 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)) t_3 = Float64(Float64(c + Float64(x * y)) - t_1) tmp = 0.0 if (Float64(a * b) <= -5e+117) tmp = t_3; elseif (Float64(a * b) <= 5e+79) tmp = Float64(c + Float64(Float64(x * y) + t_2)); elseif (Float64(a * b) <= 1e+170) tmp = Float64(t_2 - t_1); else tmp = t_3; 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); t_3 = (c + (x * y)) - t_1; tmp = 0.0; if ((a * b) <= -5e+117) tmp = t_3; elseif ((a * b) <= 5e+79) tmp = c + ((x * y) + t_2); elseif ((a * b) <= 1e+170) tmp = t_2 - t_1; else tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+117], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5e+79], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+170], N[(t$95$2 - t$95$1), $MachinePrecision], t$95$3]]]]]]
\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)\\
t_3 := \left(c + x \cdot y\right) - t_1\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+117}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+79}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+170}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999983e117 or 1.00000000000000003e170 < (*.f64 a b) Initial program 89.6%
Taylor expanded in z around 0 87.4%
if -4.99999999999999983e117 < (*.f64 a b) < 5e79Initial program 99.4%
Taylor expanded in a around 0 91.4%
if 5e79 < (*.f64 a b) < 1.00000000000000003e170Initial program 100.0%
Taylor expanded in x around 0 92.3%
Taylor expanded in c around 0 90.6%
Final simplification90.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (+ (* x y) t_1)))
(if (<= (* x y) -1.9e+43)
t_2
(if (<= (* x y) -2.9e-123)
(+ c t_1)
(if (<= (* x y) 5.8e+80) (+ c (* a (* b -0.25))) t_2)))))
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 = (x * y) + t_1;
double tmp;
if ((x * y) <= -1.9e+43) {
tmp = t_2;
} else if ((x * y) <= -2.9e-123) {
tmp = c + t_1;
} else if ((x * y) <= 5.8e+80) {
tmp = c + (a * (b * -0.25));
} 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 = 0.0625d0 * (z * t)
t_2 = (x * y) + t_1
if ((x * y) <= (-1.9d+43)) then
tmp = t_2
else if ((x * y) <= (-2.9d-123)) then
tmp = c + t_1
else if ((x * y) <= 5.8d+80) then
tmp = c + (a * (b * (-0.25d0)))
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 = 0.0625 * (z * t);
double t_2 = (x * y) + t_1;
double tmp;
if ((x * y) <= -1.9e+43) {
tmp = t_2;
} else if ((x * y) <= -2.9e-123) {
tmp = c + t_1;
} else if ((x * y) <= 5.8e+80) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (x * y) + t_1 tmp = 0 if (x * y) <= -1.9e+43: tmp = t_2 elif (x * y) <= -2.9e-123: tmp = c + t_1 elif (x * y) <= 5.8e+80: tmp = c + (a * (b * -0.25)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(x * y) + t_1) tmp = 0.0 if (Float64(x * y) <= -1.9e+43) tmp = t_2; elseif (Float64(x * y) <= -2.9e-123) tmp = Float64(c + t_1); elseif (Float64(x * y) <= 5.8e+80) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (x * y) + t_1; tmp = 0.0; if ((x * y) <= -1.9e+43) tmp = t_2; elseif ((x * y) <= -2.9e-123) tmp = c + t_1; elseif ((x * y) <= 5.8e+80) tmp = c + (a * (b * -0.25)); else tmp = t_2; 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[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.9e+43], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.9e-123], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.8e+80], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := x \cdot y + t_1\\
\mathbf{if}\;x \cdot y \leq -1.9 \cdot 10^{+43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-123}:\\
\;\;\;\;c + t_1\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{+80}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.90000000000000004e43 or 5.79999999999999971e80 < (*.f64 x y) Initial program 94.5%
Taylor expanded in a around 0 84.0%
Taylor expanded in c around 0 82.2%
if -1.90000000000000004e43 < (*.f64 x y) < -2.90000000000000004e-123Initial program 100.0%
Taylor expanded in z around inf 76.5%
if -2.90000000000000004e-123 < (*.f64 x y) < 5.79999999999999971e80Initial program 97.4%
Taylor expanded in a around inf 69.0%
*-commutative69.0%
associate-*r*69.0%
Simplified69.0%
Final simplification75.4%
(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+117)
(- (+ c (* x y)) t_1)
(if (<= (* a b) 5e-78) (+ c (+ (* x y) t_2)) (- (+ c 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+117) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 5e-78) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + 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+117)) then
tmp = (c + (x * y)) - t_1
else if ((a * b) <= 5d-78) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + 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+117) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 5e-78) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + 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+117: tmp = (c + (x * y)) - t_1 elif (a * b) <= 5e-78: tmp = c + ((x * y) + t_2) else: tmp = (c + 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+117) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(a * b) <= 5e-78) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + 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+117) tmp = (c + (x * y)) - t_1; elseif ((a * b) <= 5e-78) tmp = c + ((x * y) + t_2); else tmp = (c + 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+117], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e-78], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$2), $MachinePrecision] - 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^{+117}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-78}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999983e117Initial program 90.0%
Taylor expanded in z around 0 85.7%
if -4.99999999999999983e117 < (*.f64 a b) < 4.9999999999999996e-78Initial program 99.3%
Taylor expanded in a around 0 95.1%
if 4.9999999999999996e-78 < (*.f64 a b) Initial program 95.2%
Taylor expanded in x around 0 85.3%
Final simplification90.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -7.4e+59)
t_1
(if (<= (* x y) -1.5e-139)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 4.5e+81) (+ 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) <= -7.4e+59) {
tmp = t_1;
} else if ((x * y) <= -1.5e-139) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 4.5e+81) {
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) <= (-7.4d+59)) then
tmp = t_1
else if ((x * y) <= (-1.5d-139)) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 4.5d+81) 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) <= -7.4e+59) {
tmp = t_1;
} else if ((x * y) <= -1.5e-139) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 4.5e+81) {
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) <= -7.4e+59: tmp = t_1 elif (x * y) <= -1.5e-139: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 4.5e+81: 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) <= -7.4e+59) tmp = t_1; elseif (Float64(x * y) <= -1.5e-139) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 4.5e+81) 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) <= -7.4e+59) tmp = t_1; elseif ((x * y) <= -1.5e-139) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 4.5e+81) 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], -7.4e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e-139], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.5e+81], 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 -7.4 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-139}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+81}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -7.39999999999999995e59 or 4.50000000000000017e81 < (*.f64 x y) Initial program 94.4%
Taylor expanded in x around inf 70.2%
if -7.39999999999999995e59 < (*.f64 x y) < -1.5e-139Initial program 100.0%
Taylor expanded in z around inf 74.2%
if -1.5e-139 < (*.f64 x y) < 4.50000000000000017e81Initial program 97.4%
Taylor expanded in a around inf 69.0%
*-commutative69.0%
associate-*r*69.0%
Simplified69.0%
Final simplification70.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+117)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 1e+170)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* 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) <= -5e+117) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+170) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (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) <= (-5d+117)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 1d+170) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (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) <= -5e+117) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+170) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+117: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 1e+170: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+117) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 1e+170) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+117) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 1e+170) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+117], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+170], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+117}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 10^{+170}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999983e117Initial program 90.0%
Taylor expanded in z around 0 85.7%
Taylor expanded in c around 0 83.3%
if -4.99999999999999983e117 < (*.f64 a b) < 1.00000000000000003e170Initial program 99.4%
Taylor expanded in a around 0 88.9%
if 1.00000000000000003e170 < (*.f64 a b) Initial program 89.1%
Taylor expanded in a around inf 83.0%
*-commutative83.0%
associate-*r*85.3%
Simplified85.3%
Final simplification87.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -1.05e+51)
(* x y)
(if (<= (* x y) -9.2e-141)
(* 0.0625 (* z t))
(if (<= (* x y) 1.76e+87) (* a (* b -0.25)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -1.05e+51) {
tmp = x * y;
} else if ((x * y) <= -9.2e-141) {
tmp = 0.0625 * (z * t);
} else if ((x * y) <= 1.76e+87) {
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) :: tmp
if ((x * y) <= (-1.05d+51)) then
tmp = x * y
else if ((x * y) <= (-9.2d-141)) then
tmp = 0.0625d0 * (z * t)
else if ((x * y) <= 1.76d+87) 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 tmp;
if ((x * y) <= -1.05e+51) {
tmp = x * y;
} else if ((x * y) <= -9.2e-141) {
tmp = 0.0625 * (z * t);
} else if ((x * y) <= 1.76e+87) {
tmp = a * (b * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -1.05e+51: tmp = x * y elif (x * y) <= -9.2e-141: tmp = 0.0625 * (z * t) elif (x * y) <= 1.76e+87: tmp = a * (b * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -1.05e+51) tmp = Float64(x * y); elseif (Float64(x * y) <= -9.2e-141) tmp = Float64(0.0625 * Float64(z * t)); elseif (Float64(x * y) <= 1.76e+87) tmp = Float64(a * Float64(b * -0.25)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -1.05e+51) tmp = x * y; elseif ((x * y) <= -9.2e-141) tmp = 0.0625 * (z * t); elseif ((x * y) <= 1.76e+87) tmp = a * (b * -0.25); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+51], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -9.2e-141], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.76e+87], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+51}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -9.2 \cdot 10^{-141}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 1.76 \cdot 10^{+87}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0500000000000001e51 or 1.76000000000000003e87 < (*.f64 x y) Initial program 94.4%
Taylor expanded in z around 0 79.8%
Taylor expanded in x around inf 68.3%
if -1.0500000000000001e51 < (*.f64 x y) < -9.1999999999999998e-141Initial program 100.0%
Taylor expanded in z around inf 74.2%
Taylor expanded in t around inf 45.3%
if -9.1999999999999998e-141 < (*.f64 x y) < 1.76000000000000003e87Initial program 97.4%
Taylor expanded in z around 0 72.3%
Taylor expanded in a around inf 45.7%
*-commutative45.7%
associate-*r*45.7%
Simplified45.7%
Final simplification54.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.3e+60) (not (<= (* x y) 7e+27))) (* 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 (((x * y) <= -1.3e+60) || !((x * y) <= 7e+27)) {
tmp = x * y;
} else {
tmp = 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 (((x * y) <= (-1.3d+60)) .or. (.not. ((x * y) <= 7d+27))) then
tmp = x * y
else
tmp = 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 (((x * y) <= -1.3e+60) || !((x * y) <= 7e+27)) {
tmp = x * y;
} else {
tmp = 0.0625 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.3e+60) or not ((x * y) <= 7e+27): tmp = x * y else: tmp = 0.0625 * (z * t) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.3e+60) || !(Float64(x * y) <= 7e+27)) tmp = Float64(x * y); else tmp = 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 (((x * y) <= -1.3e+60) || ~(((x * y) <= 7e+27))) tmp = x * y; else tmp = 0.0625 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.3e+60], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7e+27]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.3 \cdot 10^{+60} \lor \neg \left(x \cdot y \leq 7 \cdot 10^{+27}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.30000000000000004e60 or 7.0000000000000004e27 < (*.f64 x y) Initial program 95.0%
Taylor expanded in z around 0 80.2%
Taylor expanded in x around inf 63.6%
if -1.30000000000000004e60 < (*.f64 x y) < 7.0000000000000004e27Initial program 97.9%
Taylor expanded in z around inf 59.2%
Taylor expanded in t around inf 34.1%
Final simplification47.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.1e+44) (not (<= (* x y) 29500.0))) (* 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.1e+44) || !((x * y) <= 29500.0)) {
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.1d+44)) .or. (.not. ((x * y) <= 29500.0d0))) 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.1e+44) || !((x * y) <= 29500.0)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.1e+44) or not ((x * y) <= 29500.0): 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.1e+44) || !(Float64(x * y) <= 29500.0)) 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.1e+44) || ~(((x * y) <= 29500.0))) 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.1e+44], N[Not[LessEqual[N[(x * y), $MachinePrecision], 29500.0]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.1 \cdot 10^{+44} \lor \neg \left(x \cdot y \leq 29500\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.09999999999999998e44 or 29500 < (*.f64 x y) Initial program 95.2%
Taylor expanded in z around 0 79.6%
Taylor expanded in x around inf 61.4%
if -1.09999999999999998e44 < (*.f64 x y) < 29500Initial program 97.8%
Taylor expanded in c around inf 28.1%
Final simplification43.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.35e+111) (not (<= a 2.3e-52))) (* a (* b -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.35e+111) || !(a <= 2.3e-52)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a <= (-1.35d+111)) .or. (.not. (a <= 2.3d-52))) then
tmp = a * (b * (-0.25d0))
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.35e+111) || !(a <= 2.3e-52)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.35e+111) or not (a <= 2.3e-52): tmp = a * (b * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.35e+111) || !(a <= 2.3e-52)) tmp = Float64(a * Float64(b * -0.25)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a <= -1.35e+111) || ~((a <= 2.3e-52))) tmp = a * (b * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -1.35e+111], N[Not[LessEqual[a, 2.3e-52]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+111} \lor \neg \left(a \leq 2.3 \cdot 10^{-52}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.3499999999999999e111 or 2.29999999999999994e-52 < a Initial program 93.4%
Taylor expanded in z around 0 76.2%
Taylor expanded in a around inf 49.1%
*-commutative49.1%
associate-*r*49.8%
Simplified49.8%
if -1.3499999999999999e111 < a < 2.29999999999999994e-52Initial program 99.3%
Taylor expanded in x around inf 58.5%
Final simplification54.5%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.5%
Taylor expanded in c around inf 17.4%
Final simplification17.4%
herbie shell --seed 2024010
(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))