
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 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 97.6%
associate-+l-97.6%
associate--l+97.6%
fma-def98.0%
associate-*l/98.0%
fma-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
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 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma (* z 0.0625) t (* 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 = fma((z * 0.0625), t, (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 = fma(Float64(z * 0.0625), t, Float64(a * Float64(b * -0.25))); end return 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[(N[(z * 0.0625), $MachinePrecision] * t + N[(a * N[(b * -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}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, a \cdot \left(b \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around 0 16.7%
Taylor expanded in c around 0 16.7%
*-commutative16.7%
associate-*r*16.7%
fma-neg66.7%
*-commutative66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
metadata-eval66.7%
associate-*r*66.7%
*-commutative66.7%
Applied egg-rr66.7%
Final simplification99.2%
(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 (* 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 * (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 * (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 * (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(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 * (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[(a * -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}:\\
\;\;\;\;b \cdot \left(a \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 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around 0 16.7%
Taylor expanded in a around inf 66.7%
*-commutative66.7%
*-commutative66.7%
associate-*l*66.7%
Simplified66.7%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))))
(if (<= (* x y) -2.25e+108)
(* x y)
(if (<= (* x y) -3.1e-46)
c
(if (<= (* x y) -4.5e-142)
t_1
(if (<= (* x y) -1.5e-261)
(* b (* a -0.25))
(if (<= (* x y) 6.4e+52) t_1 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -2.25e+108) {
tmp = x * y;
} else if ((x * y) <= -3.1e-46) {
tmp = c;
} else if ((x * y) <= -4.5e-142) {
tmp = t_1;
} else if ((x * y) <= -1.5e-261) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 6.4e+52) {
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 = t * (z * 0.0625d0)
if ((x * y) <= (-2.25d+108)) then
tmp = x * y
else if ((x * y) <= (-3.1d-46)) then
tmp = c
else if ((x * y) <= (-4.5d-142)) then
tmp = t_1
else if ((x * y) <= (-1.5d-261)) then
tmp = b * (a * (-0.25d0))
else if ((x * y) <= 6.4d+52) 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 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -2.25e+108) {
tmp = x * y;
} else if ((x * y) <= -3.1e-46) {
tmp = c;
} else if ((x * y) <= -4.5e-142) {
tmp = t_1;
} else if ((x * y) <= -1.5e-261) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 6.4e+52) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) tmp = 0 if (x * y) <= -2.25e+108: tmp = x * y elif (x * y) <= -3.1e-46: tmp = c elif (x * y) <= -4.5e-142: tmp = t_1 elif (x * y) <= -1.5e-261: tmp = b * (a * -0.25) elif (x * y) <= 6.4e+52: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -2.25e+108) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.1e-46) tmp = c; elseif (Float64(x * y) <= -4.5e-142) tmp = t_1; elseif (Float64(x * y) <= -1.5e-261) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(x * y) <= 6.4e+52) 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 = t * (z * 0.0625); tmp = 0.0; if ((x * y) <= -2.25e+108) tmp = x * y; elseif ((x * y) <= -3.1e-46) tmp = c; elseif ((x * y) <= -4.5e-142) tmp = t_1; elseif ((x * y) <= -1.5e-261) tmp = b * (a * -0.25); elseif ((x * y) <= 6.4e+52) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.25e+108], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.1e-46], c, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-142], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e-261], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.4e+52], t$95$1, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+108}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-46}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-261}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.25e108 or 6.4e52 < (*.f64 x y) Initial program 95.0%
Taylor expanded in a around 0 81.5%
Taylor expanded in x around inf 66.8%
if -2.25e108 < (*.f64 x y) < -3.1000000000000001e-46Initial program 100.0%
Taylor expanded in c around inf 46.7%
if -3.1000000000000001e-46 < (*.f64 x y) < -4.50000000000000019e-142 or -1.5e-261 < (*.f64 x y) < 6.4e52Initial program 99.0%
Taylor expanded in a around 0 73.5%
Taylor expanded in t around inf 42.9%
*-commutative42.9%
associate-*l*42.9%
*-commutative42.9%
Simplified42.9%
if -4.50000000000000019e-142 < (*.f64 x y) < -1.5e-261Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in a around inf 57.1%
*-commutative57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
Final simplification53.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -2.7e+140)
t_2
(if (<= (* x y) -9.5e-91)
t_1
(if (<= (* x y) -8.5e-121)
(* t (* z 0.0625))
(if (<= (* x y) 2.9e+55) t_1 t_2))))))
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 = c + (x * y);
double tmp;
if ((x * y) <= -2.7e+140) {
tmp = t_2;
} else if ((x * y) <= -9.5e-91) {
tmp = t_1;
} else if ((x * y) <= -8.5e-121) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 2.9e+55) {
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 + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-2.7d+140)) then
tmp = t_2
else if ((x * y) <= (-9.5d-91)) then
tmp = t_1
else if ((x * y) <= (-8.5d-121)) then
tmp = t * (z * 0.0625d0)
else if ((x * y) <= 2.9d+55) 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 + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -2.7e+140) {
tmp = t_2;
} else if ((x * y) <= -9.5e-91) {
tmp = t_1;
} else if ((x * y) <= -8.5e-121) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 2.9e+55) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -2.7e+140: tmp = t_2 elif (x * y) <= -9.5e-91: tmp = t_1 elif (x * y) <= -8.5e-121: tmp = t * (z * 0.0625) elif (x * y) <= 2.9e+55: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2.7e+140) tmp = t_2; elseif (Float64(x * y) <= -9.5e-91) tmp = t_1; elseif (Float64(x * y) <= -8.5e-121) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(x * y) <= 2.9e+55) 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 + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -2.7e+140) tmp = t_2; elseif ((x * y) <= -9.5e-91) tmp = t_1; elseif ((x * y) <= -8.5e-121) tmp = t * (z * 0.0625); elseif ((x * y) <= 2.9e+55) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.7e+140], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -9.5e-91], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e-121], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.9e+55], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+140}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{-91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-121}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.70000000000000018e140 or 2.8999999999999999e55 < (*.f64 x y) Initial program 95.6%
Taylor expanded in x around inf 73.9%
if -2.70000000000000018e140 < (*.f64 x y) < -9.5e-91 or -8.50000000000000025e-121 < (*.f64 x y) < 2.8999999999999999e55Initial program 98.7%
Taylor expanded in a around inf 62.3%
*-commutative62.3%
associate-*r*62.3%
Simplified62.3%
if -9.5e-91 < (*.f64 x y) < -8.50000000000000025e-121Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
Final simplification67.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -2.5e+58)
t_2
(if (<= (* x y) -2.5e-136)
t_1
(if (<= (* x y) -1e-260)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 4.6e+47) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -2.5e+58) {
tmp = t_2;
} else if ((x * y) <= -2.5e-136) {
tmp = t_1;
} else if ((x * y) <= -1e-260) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4.6e+47) {
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 + (z * (t * 0.0625d0))
t_2 = c + (x * y)
if ((x * y) <= (-2.5d+58)) then
tmp = t_2
else if ((x * y) <= (-2.5d-136)) then
tmp = t_1
else if ((x * y) <= (-1d-260)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 4.6d+47) 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 + (z * (t * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -2.5e+58) {
tmp = t_2;
} else if ((x * y) <= -2.5e-136) {
tmp = t_1;
} else if ((x * y) <= -1e-260) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4.6e+47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -2.5e+58: tmp = t_2 elif (x * y) <= -2.5e-136: tmp = t_1 elif (x * y) <= -1e-260: tmp = c + (a * (b * -0.25)) elif (x * y) <= 4.6e+47: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2.5e+58) tmp = t_2; elseif (Float64(x * y) <= -2.5e-136) tmp = t_1; elseif (Float64(x * y) <= -1e-260) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 4.6e+47) 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 + (z * (t * 0.0625)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -2.5e+58) tmp = t_2; elseif ((x * y) <= -2.5e-136) tmp = t_1; elseif ((x * y) <= -1e-260) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 4.6e+47) 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[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e+58], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e-136], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-260], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.6e+47], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2.5 \cdot 10^{+58}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-260}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.49999999999999993e58 or 4.5999999999999997e47 < (*.f64 x y) Initial program 95.5%
Taylor expanded in x around inf 70.3%
if -2.49999999999999993e58 < (*.f64 x y) < -2.5000000000000001e-136 or -9.99999999999999961e-261 < (*.f64 x y) < 4.5999999999999997e47Initial program 99.2%
Taylor expanded in z around inf 69.9%
associate-*r*69.9%
*-commutative69.9%
Simplified69.9%
if -2.5000000000000001e-136 < (*.f64 x y) < -9.99999999999999961e-261Initial program 100.0%
Taylor expanded in a around inf 94.1%
*-commutative94.1%
associate-*r*94.1%
Simplified94.1%
Final simplification71.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (or (<= (* a b) -5e+119) (not (<= (* a b) 1e-22)))
(- (+ c t_1) (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
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 (((a * b) <= -5e+119) || !((a * b) <= 1e-22)) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + 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 = (z * t) * 0.0625d0
if (((a * b) <= (-5d+119)) .or. (.not. ((a * b) <= 1d-22))) then
tmp = (c + t_1) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + 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 = (z * t) * 0.0625;
double tmp;
if (((a * b) <= -5e+119) || !((a * b) <= 1e-22)) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if ((a * b) <= -5e+119) or not ((a * b) <= 1e-22): tmp = (c + t_1) - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if ((Float64(a * b) <= -5e+119) || !(Float64(a * b) <= 1e-22)) tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); 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 (((a * b) <= -5e+119) || ~(((a * b) <= 1e-22))) tmp = (c + t_1) - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+119], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-22]], $MachinePrecision]], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+119} \lor \neg \left(a \cdot b \leq 10^{-22}\right):\\
\;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e119 or 1e-22 < (*.f64 a b) Initial program 94.5%
Taylor expanded in x around 0 82.9%
if -4.9999999999999999e119 < (*.f64 a b) < 1e-22Initial program 100.0%
Taylor expanded in a around 0 97.4%
Final simplification91.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (or (<= (* a b) -1e+134) (not (<= (* a b) 5e+160)))
(- t_1 (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
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 (((a * b) <= -1e+134) || !((a * b) <= 5e+160)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + 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 = (z * t) * 0.0625d0
if (((a * b) <= (-1d+134)) .or. (.not. ((a * b) <= 5d+160))) then
tmp = t_1 - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + 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 = (z * t) * 0.0625;
double tmp;
if (((a * b) <= -1e+134) || !((a * b) <= 5e+160)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if ((a * b) <= -1e+134) or not ((a * b) <= 5e+160): tmp = t_1 - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if ((Float64(a * b) <= -1e+134) || !(Float64(a * b) <= 5e+160)) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); 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 (((a * b) <= -1e+134) || ~(((a * b) <= 5e+160))) tmp = t_1 - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+134], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+160]], $MachinePrecision]], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+134} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+160}\right):\\
\;\;\;\;t_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999921e133 or 5.0000000000000002e160 < (*.f64 a b) Initial program 91.6%
Taylor expanded in x around 0 85.1%
Taylor expanded in c around 0 81.2%
if -9.99999999999999921e133 < (*.f64 a b) < 5.0000000000000002e160Initial program 100.0%
Taylor expanded in a around 0 91.4%
Final simplification88.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ (* x y) (* (* z t) 0.0625))))
(if (<= z -2.9e-116)
t_2
(if (<= z 1.9e-190)
t_1
(if (<= z 2.15e-98) (+ c (* x y)) (if (<= z 1.3e+47) t_1 t_2))))))
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 = (x * y) + ((z * t) * 0.0625);
double tmp;
if (z <= -2.9e-116) {
tmp = t_2;
} else if (z <= 1.9e-190) {
tmp = t_1;
} else if (z <= 2.15e-98) {
tmp = c + (x * y);
} else if (z <= 1.3e+47) {
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 + (a * (b * (-0.25d0)))
t_2 = (x * y) + ((z * t) * 0.0625d0)
if (z <= (-2.9d-116)) then
tmp = t_2
else if (z <= 1.9d-190) then
tmp = t_1
else if (z <= 2.15d-98) then
tmp = c + (x * y)
else if (z <= 1.3d+47) 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 + (a * (b * -0.25));
double t_2 = (x * y) + ((z * t) * 0.0625);
double tmp;
if (z <= -2.9e-116) {
tmp = t_2;
} else if (z <= 1.9e-190) {
tmp = t_1;
} else if (z <= 2.15e-98) {
tmp = c + (x * y);
} else if (z <= 1.3e+47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = (x * y) + ((z * t) * 0.0625) tmp = 0 if z <= -2.9e-116: tmp = t_2 elif z <= 1.9e-190: tmp = t_1 elif z <= 2.15e-98: tmp = c + (x * y) elif z <= 1.3e+47: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)) tmp = 0.0 if (z <= -2.9e-116) tmp = t_2; elseif (z <= 1.9e-190) tmp = t_1; elseif (z <= 2.15e-98) tmp = Float64(c + Float64(x * y)); elseif (z <= 1.3e+47) 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 + (a * (b * -0.25)); t_2 = (x * y) + ((z * t) * 0.0625); tmp = 0.0; if (z <= -2.9e-116) tmp = t_2; elseif (z <= 1.9e-190) tmp = t_1; elseif (z <= 2.15e-98) tmp = c + (x * y); elseif (z <= 1.3e+47) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-116], t$95$2, If[LessEqual[z, 1.9e-190], t$95$1, If[LessEqual[z, 2.15e-98], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+47], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-116}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-98}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.8999999999999998e-116 or 1.30000000000000002e47 < z Initial program 96.3%
Taylor expanded in a around 0 83.0%
Taylor expanded in c around 0 67.9%
if -2.8999999999999998e-116 < z < 1.8999999999999999e-190 or 2.14999999999999994e-98 < z < 1.30000000000000002e47Initial program 100.0%
Taylor expanded in a around inf 61.7%
*-commutative61.7%
associate-*r*61.7%
Simplified61.7%
if 1.8999999999999999e-190 < z < 2.14999999999999994e-98Initial program 94.7%
Taylor expanded in x around inf 77.8%
Final simplification66.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -7e+108)
(* x y)
(if (<= (* x y) -2.7e-125)
c
(if (<= (* x y) 1.45e+55) (* b (* a -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) <= -7e+108) {
tmp = x * y;
} else if ((x * y) <= -2.7e-125) {
tmp = c;
} else if ((x * y) <= 1.45e+55) {
tmp = b * (a * -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) <= (-7d+108)) then
tmp = x * y
else if ((x * y) <= (-2.7d-125)) then
tmp = c
else if ((x * y) <= 1.45d+55) then
tmp = b * (a * (-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) <= -7e+108) {
tmp = x * y;
} else if ((x * y) <= -2.7e-125) {
tmp = c;
} else if ((x * y) <= 1.45e+55) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -7e+108: tmp = x * y elif (x * y) <= -2.7e-125: tmp = c elif (x * y) <= 1.45e+55: tmp = b * (a * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -7e+108) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.7e-125) tmp = c; elseif (Float64(x * y) <= 1.45e+55) tmp = Float64(b * Float64(a * -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) <= -7e+108) tmp = x * y; elseif ((x * y) <= -2.7e-125) tmp = c; elseif ((x * y) <= 1.45e+55) tmp = b * (a * -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], -7e+108], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.7e-125], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.45e+55], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+108}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.7 \cdot 10^{-125}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.45 \cdot 10^{+55}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.0000000000000005e108 or 1.4499999999999999e55 < (*.f64 x y) Initial program 94.9%
Taylor expanded in a around 0 82.3%
Taylor expanded in x around inf 67.5%
if -7.0000000000000005e108 < (*.f64 x y) < -2.6999999999999998e-125Initial program 100.0%
Taylor expanded in c around inf 41.9%
if -2.6999999999999998e-125 < (*.f64 x y) < 1.4499999999999999e55Initial program 99.1%
Taylor expanded in x around 0 94.4%
Taylor expanded in a around inf 34.9%
*-commutative34.9%
*-commutative34.9%
associate-*l*34.9%
Simplified34.9%
Final simplification48.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= b -6.2e+147)
(* b (* a -0.25))
(if (<= b 3.8e+217)
(+ c (+ (* x y) (* (* z t) 0.0625)))
(+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -6.2e+147) {
tmp = b * (a * -0.25);
} else if (b <= 3.8e+217) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} 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 (b <= (-6.2d+147)) then
tmp = b * (a * (-0.25d0))
else if (b <= 3.8d+217) then
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
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 (b <= -6.2e+147) {
tmp = b * (a * -0.25);
} else if (b <= 3.8e+217) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -6.2e+147: tmp = b * (a * -0.25) elif b <= 3.8e+217: tmp = c + ((x * y) + ((z * t) * 0.0625)) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -6.2e+147) tmp = Float64(b * Float64(a * -0.25)); elseif (b <= 3.8e+217) tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); 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 (b <= -6.2e+147) tmp = b * (a * -0.25); elseif (b <= 3.8e+217) tmp = c + ((x * y) + ((z * t) * 0.0625)); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -6.2e+147], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.8e+217], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.2 \cdot 10^{+147}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+217}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if b < -6.2000000000000001e147Initial program 93.0%
Taylor expanded in x around 0 83.1%
Taylor expanded in a around inf 56.8%
*-commutative56.8%
*-commutative56.8%
associate-*l*56.8%
Simplified56.8%
if -6.2000000000000001e147 < b < 3.80000000000000002e217Initial program 99.0%
Taylor expanded in a around 0 83.3%
if 3.80000000000000002e217 < b Initial program 91.3%
Taylor expanded in a around inf 79.4%
*-commutative79.4%
associate-*r*79.4%
Simplified79.4%
Final simplification80.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* t (* z 0.0625))))
(if (<= z -3.7e+114)
t_2
(if (<= z 1.45e-298)
t_1
(if (<= z 1.56e-277) (* b (* a -0.25)) (if (<= z 1e+46) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = t * (z * 0.0625);
double tmp;
if (z <= -3.7e+114) {
tmp = t_2;
} else if (z <= 1.45e-298) {
tmp = t_1;
} else if (z <= 1.56e-277) {
tmp = b * (a * -0.25);
} else if (z <= 1e+46) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = t * (z * 0.0625d0)
if (z <= (-3.7d+114)) then
tmp = t_2
else if (z <= 1.45d-298) then
tmp = t_1
else if (z <= 1.56d-277) then
tmp = b * (a * (-0.25d0))
else if (z <= 1d+46) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = t * (z * 0.0625);
double tmp;
if (z <= -3.7e+114) {
tmp = t_2;
} else if (z <= 1.45e-298) {
tmp = t_1;
} else if (z <= 1.56e-277) {
tmp = b * (a * -0.25);
} else if (z <= 1e+46) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = t * (z * 0.0625) tmp = 0 if z <= -3.7e+114: tmp = t_2 elif z <= 1.45e-298: tmp = t_1 elif z <= 1.56e-277: tmp = b * (a * -0.25) elif z <= 1e+46: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (z <= -3.7e+114) tmp = t_2; elseif (z <= 1.45e-298) tmp = t_1; elseif (z <= 1.56e-277) tmp = Float64(b * Float64(a * -0.25)); elseif (z <= 1e+46) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = t * (z * 0.0625); tmp = 0.0; if (z <= -3.7e+114) tmp = t_2; elseif (z <= 1.45e-298) tmp = t_1; elseif (z <= 1.56e-277) tmp = b * (a * -0.25); elseif (z <= 1e+46) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+114], t$95$2, If[LessEqual[z, 1.45e-298], t$95$1, If[LessEqual[z, 1.56e-277], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+46], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+114}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-298}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.56 \cdot 10^{-277}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;z \leq 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.7000000000000001e114 or 9.9999999999999999e45 < z Initial program 95.6%
Taylor expanded in a around 0 85.9%
Taylor expanded in t around inf 53.1%
*-commutative53.1%
associate-*l*53.1%
*-commutative53.1%
Simplified53.1%
if -3.7000000000000001e114 < z < 1.45000000000000007e-298 or 1.56e-277 < z < 9.9999999999999999e45Initial program 98.7%
Taylor expanded in x around inf 61.5%
if 1.45000000000000007e-298 < z < 1.56e-277Initial program 100.0%
Taylor expanded in x around 0 90.8%
Taylor expanded in a around inf 70.9%
*-commutative70.9%
*-commutative70.9%
associate-*l*70.9%
Simplified70.9%
Final simplification58.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.9e+109) (not (<= (* x y) 1.25e+34))) (* 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.9e+109) || !((x * y) <= 1.25e+34)) {
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.9d+109)) .or. (.not. ((x * y) <= 1.25d+34))) 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.9e+109) || !((x * y) <= 1.25e+34)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.9e+109) or not ((x * y) <= 1.25e+34): 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.9e+109) || !(Float64(x * y) <= 1.25e+34)) 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.9e+109) || ~(((x * y) <= 1.25e+34))) 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.9e+109], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.25e+34]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+109} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.9e109 or 1.25e34 < (*.f64 x y) Initial program 95.1%
Taylor expanded in a around 0 82.1%
Taylor expanded in x around inf 65.9%
if -2.9e109 < (*.f64 x y) < 1.25e34Initial program 99.3%
Taylor expanded in c around inf 32.7%
Final simplification46.1%
(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 22.2%
Final simplification22.2%
herbie shell --seed 2023332
(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))