
(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 16 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 98.1%
associate-+l-98.1%
associate--l+98.1%
fma-def98.9%
associate-*l/98.9%
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 98.1%
sub-neg98.1%
associate-+l+98.1%
fma-def98.9%
associate-*l/98.9%
distribute-frac-neg98.9%
distribute-rgt-neg-out98.9%
associate-/l*99.2%
neg-mul-199.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(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) -1.25e+77)
(+ c (* x y))
(if (<= (* x y) -1.45e-43)
t_2
(if (<= (* x y) -5.5e-79)
t_3
(if (<= (* x y) 0.0)
t_2
(if (<= (* x y) 2.7e-46) t_3 (+ (* x y) 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 t_2 = c + t_1;
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -1.25e+77) {
tmp = c + (x * y);
} else if ((x * y) <= -1.45e-43) {
tmp = t_2;
} else if ((x * y) <= -5.5e-79) {
tmp = t_3;
} else if ((x * y) <= 0.0) {
tmp = t_2;
} else if ((x * y) <= 2.7e-46) {
tmp = t_3;
} else {
tmp = (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) :: 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) <= (-1.25d+77)) then
tmp = c + (x * y)
else if ((x * y) <= (-1.45d-43)) then
tmp = t_2
else if ((x * y) <= (-5.5d-79)) then
tmp = t_3
else if ((x * y) <= 0.0d0) then
tmp = t_2
else if ((x * y) <= 2.7d-46) then
tmp = t_3
else
tmp = (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 = 0.0625 * (z * t);
double t_2 = c + t_1;
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -1.25e+77) {
tmp = c + (x * y);
} else if ((x * y) <= -1.45e-43) {
tmp = t_2;
} else if ((x * y) <= -5.5e-79) {
tmp = t_3;
} else if ((x * y) <= 0.0) {
tmp = t_2;
} else if ((x * y) <= 2.7e-46) {
tmp = t_3;
} else {
tmp = (x * y) + t_1;
}
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) <= -1.25e+77: tmp = c + (x * y) elif (x * y) <= -1.45e-43: tmp = t_2 elif (x * y) <= -5.5e-79: tmp = t_3 elif (x * y) <= 0.0: tmp = t_2 elif (x * y) <= 2.7e-46: tmp = t_3 else: tmp = (x * y) + t_1 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) <= -1.25e+77) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= -1.45e-43) tmp = t_2; elseif (Float64(x * y) <= -5.5e-79) tmp = t_3; elseif (Float64(x * y) <= 0.0) tmp = t_2; elseif (Float64(x * y) <= 2.7e-46) tmp = t_3; else tmp = Float64(Float64(x * y) + t_1); 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) <= -1.25e+77) tmp = c + (x * y); elseif ((x * y) <= -1.45e-43) tmp = t_2; elseif ((x * y) <= -5.5e-79) tmp = t_3; elseif ((x * y) <= 0.0) tmp = t_2; elseif ((x * y) <= 2.7e-46) tmp = t_3; else tmp = (x * y) + 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]}, 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], -1.25e+77], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.45e-43], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5.5e-79], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.7e-46], t$95$3, N[(N[(x * y), $MachinePrecision] + t$95$1), $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 -1.25 \cdot 10^{+77}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{-43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-79}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-46}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.25000000000000001e77Initial program 97.1%
Taylor expanded in z around 0 94.4%
Taylor expanded in a around 0 86.2%
if -1.25000000000000001e77 < (*.f64 x y) < -1.4500000000000001e-43 or -5.4999999999999997e-79 < (*.f64 x y) < 0.0Initial program 100.0%
Taylor expanded in x around 0 99.0%
Taylor expanded in a around 0 73.3%
if -1.4500000000000001e-43 < (*.f64 x y) < -5.4999999999999997e-79 or 0.0 < (*.f64 x y) < 2.7e-46Initial program 99.9%
Taylor expanded in a around inf 78.0%
*-commutative78.0%
associate-*r*78.0%
Simplified78.0%
if 2.7e-46 < (*.f64 x y) Initial program 94.9%
associate-+l-94.9%
associate--l+94.9%
fma-def97.6%
associate-*l/97.6%
fma-neg97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
associate-/l*98.6%
distribute-frac-neg98.6%
associate-/r/98.7%
fma-def98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in a around 0 82.6%
Taylor expanded in c around 0 74.7%
Final simplification76.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -8.2e+132)
(+ c (* x y))
(if (<= (* x y) 4.8e+137)
(- (+ c (* 0.0625 (* z t))) (* 0.25 (* a b)))
(+ (+ c (/ a (/ -4.0 b))) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -8.2e+132) {
tmp = c + (x * y);
} else if ((x * y) <= 4.8e+137) {
tmp = (c + (0.0625 * (z * t))) - (0.25 * (a * b));
} else {
tmp = (c + (a / (-4.0 / b))) + (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) <= (-8.2d+132)) then
tmp = c + (x * y)
else if ((x * y) <= 4.8d+137) then
tmp = (c + (0.0625d0 * (z * t))) - (0.25d0 * (a * b))
else
tmp = (c + (a / ((-4.0d0) / b))) + (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) <= -8.2e+132) {
tmp = c + (x * y);
} else if ((x * y) <= 4.8e+137) {
tmp = (c + (0.0625 * (z * t))) - (0.25 * (a * b));
} else {
tmp = (c + (a / (-4.0 / b))) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -8.2e+132: tmp = c + (x * y) elif (x * y) <= 4.8e+137: tmp = (c + (0.0625 * (z * t))) - (0.25 * (a * b)) else: tmp = (c + (a / (-4.0 / b))) + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -8.2e+132) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= 4.8e+137) tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - Float64(0.25 * Float64(a * b))); else tmp = Float64(Float64(c + Float64(a / Float64(-4.0 / b))) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -8.2e+132) tmp = c + (x * y); elseif ((x * y) <= 4.8e+137) tmp = (c + (0.0625 * (z * t))) - (0.25 * (a * b)); else tmp = (c + (a / (-4.0 / b))) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -8.2e+132], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.8e+137], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.2 \cdot 10^{+132}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+137}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - 0.25 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + \frac{a}{\frac{-4}{b}}\right) + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.19999999999999983e132Initial program 96.3%
Taylor expanded in z around 0 96.3%
Taylor expanded in a around 0 96.3%
if -8.19999999999999983e132 < (*.f64 x y) < 4.79999999999999966e137Initial program 99.5%
Taylor expanded in x around 0 94.6%
if 4.79999999999999966e137 < (*.f64 x y) Initial program 93.0%
sub-neg93.0%
associate-+l+93.0%
fma-def97.7%
associate-*l/97.7%
distribute-frac-neg97.7%
distribute-rgt-neg-out97.7%
associate-/l*97.7%
neg-mul-197.7%
associate-/r*97.7%
metadata-eval97.7%
Simplified97.7%
fma-udef93.0%
*-commutative93.0%
div-inv93.0%
metadata-eval93.0%
Applied egg-rr93.0%
Taylor expanded in x around inf 93.2%
Final simplification94.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+45) (not (<= (* a b) 1e+30))) (+ (+ c (/ a (/ -4.0 b))) (* x y)) (+ 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+45) || !((a * b) <= 1e+30)) {
tmp = (c + (a / (-4.0 / b))) + (x * y);
} 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+45)) .or. (.not. ((a * b) <= 1d+30))) then
tmp = (c + (a / ((-4.0d0) / b))) + (x * y)
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+45) || !((a * b) <= 1e+30)) {
tmp = (c + (a / (-4.0 / b))) + (x * y);
} 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+45) or not ((a * b) <= 1e+30): tmp = (c + (a / (-4.0 / b))) + (x * y) 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+45) || !(Float64(a * b) <= 1e+30)) tmp = Float64(Float64(c + Float64(a / Float64(-4.0 / b))) + Float64(x * y)); 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+45) || ~(((a * b) <= 1e+30))) tmp = (c + (a / (-4.0 / b))) + (x * y); 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+45], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+30]], $MachinePrecision]], N[(N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * y), $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^{+45} \lor \neg \left(a \cdot b \leq 10^{+30}\right):\\
\;\;\;\;\left(c + \frac{a}{\frac{-4}{b}}\right) + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e45 or 1e30 < (*.f64 a b) Initial program 98.3%
sub-neg98.3%
associate-+l+98.4%
fma-def98.4%
associate-*l/98.4%
distribute-frac-neg98.4%
distribute-rgt-neg-out98.4%
associate-/l*99.0%
neg-mul-199.0%
associate-/r*99.0%
metadata-eval99.0%
Simplified99.0%
fma-udef99.0%
*-commutative99.0%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 88.7%
if -5e45 < (*.f64 a b) < 1e30Initial program 97.9%
Taylor expanded in a around 0 95.9%
Final simplification92.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+214)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 1e+30)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* 0.25 (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+214) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 1e+30) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - (0.25 * (a * b));
}
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+214)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 1d+30) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (x * y) - (0.25d0 * (a * b))
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+214) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 1e+30) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - (0.25 * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+214: tmp = c + (a * (b * -0.25)) elif (a * b) <= 1e+30: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - (0.25 * (a * b)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+214) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 1e+30) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(x * y) - Float64(0.25 * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+214) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 1e+30) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - (0.25 * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+214], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+30], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+214}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+30}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - 0.25 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999953e214Initial program 97.3%
Taylor expanded in a around inf 91.5%
*-commutative91.5%
associate-*r*94.1%
Simplified94.1%
if -4.99999999999999953e214 < (*.f64 a b) < 1e30Initial program 98.3%
Taylor expanded in a around 0 91.3%
if 1e30 < (*.f64 a b) Initial program 97.8%
Taylor expanded in z around 0 91.5%
Taylor expanded in c around 0 84.0%
Final simplification90.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+45)
(+ (+ c (/ a (/ -4.0 b))) (* x y))
(if (<= (* a b) 1e+30)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (+ c (* x y)) (* 0.25 (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+45) {
tmp = (c + (a / (-4.0 / b))) + (x * y);
} else if ((a * b) <= 1e+30) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - (0.25 * (a * b));
}
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+45)) then
tmp = (c + (a / ((-4.0d0) / b))) + (x * y)
else if ((a * b) <= 1d+30) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (c + (x * y)) - (0.25d0 * (a * b))
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+45) {
tmp = (c + (a / (-4.0 / b))) + (x * y);
} else if ((a * b) <= 1e+30) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - (0.25 * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+45: tmp = (c + (a / (-4.0 / b))) + (x * y) elif (a * b) <= 1e+30: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (c + (x * y)) - (0.25 * (a * b)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+45) tmp = Float64(Float64(c + Float64(a / Float64(-4.0 / b))) + Float64(x * y)); elseif (Float64(a * b) <= 1e+30) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(c + Float64(x * y)) - Float64(0.25 * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+45) tmp = (c + (a / (-4.0 / b))) + (x * y); elseif ((a * b) <= 1e+30) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (c + (x * y)) - (0.25 * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+45], N[(N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+30], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+45}:\\
\;\;\;\;\left(c + \frac{a}{\frac{-4}{b}}\right) + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 10^{+30}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e45Initial program 98.7%
sub-neg98.7%
associate-+l+98.7%
fma-def98.7%
associate-*l/98.7%
distribute-frac-neg98.7%
distribute-rgt-neg-out98.7%
associate-/l*99.8%
neg-mul-199.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
fma-udef99.8%
*-commutative99.8%
div-inv99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 86.7%
if -5e45 < (*.f64 a b) < 1e30Initial program 97.9%
Taylor expanded in a around 0 95.9%
if 1e30 < (*.f64 a b) Initial program 97.8%
Taylor expanded in z around 0 91.5%
Final simplification92.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -2e+131)
(* x y)
(if (<= (* x y) -0.0029)
c
(if (<= (* x y) 4.5e+206) (* 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) <= -2e+131) {
tmp = x * y;
} else if ((x * y) <= -0.0029) {
tmp = c;
} else if ((x * y) <= 4.5e+206) {
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) <= (-2d+131)) then
tmp = x * y
else if ((x * y) <= (-0.0029d0)) then
tmp = c
else if ((x * y) <= 4.5d+206) 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) <= -2e+131) {
tmp = x * y;
} else if ((x * y) <= -0.0029) {
tmp = c;
} else if ((x * y) <= 4.5e+206) {
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) <= -2e+131: tmp = x * y elif (x * y) <= -0.0029: tmp = c elif (x * y) <= 4.5e+206: 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) <= -2e+131) tmp = Float64(x * y); elseif (Float64(x * y) <= -0.0029) tmp = c; elseif (Float64(x * y) <= 4.5e+206) 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) <= -2e+131) tmp = x * y; elseif ((x * y) <= -0.0029) tmp = c; elseif ((x * y) <= 4.5e+206) 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], -2e+131], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -0.0029], c, If[LessEqual[N[(x * y), $MachinePrecision], 4.5e+206], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+131}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -0.0029:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+206}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999998e131 or 4.50000000000000018e206 < (*.f64 x y) Initial program 93.4%
Taylor expanded in z around 0 93.5%
Taylor expanded in c around 0 91.4%
Taylor expanded in x around inf 89.9%
if -1.9999999999999998e131 < (*.f64 x y) < -0.0029Initial program 100.0%
Taylor expanded in c around inf 46.4%
if -0.0029 < (*.f64 x y) < 4.50000000000000018e206Initial program 99.5%
sub-neg99.5%
associate-+l+99.5%
fma-def99.5%
associate-*l/99.5%
distribute-frac-neg99.5%
distribute-rgt-neg-out99.5%
associate-/l*99.9%
neg-mul-199.9%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
fma-udef99.9%
*-commutative99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 36.8%
associate-*r*37.3%
*-commutative37.3%
associate-*l*37.3%
Simplified37.3%
Final simplification50.5%
(FPCore (x y z t a b c) :precision binary64 (+ (+ c (/ a (/ -4.0 b))) (+ (* x y) (* t (* z 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (c + (a / (-4.0 / b))) + ((x * y) + (t * (z * 0.0625)));
}
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 + (a / ((-4.0d0) / b))) + ((x * y) + (t * (z * 0.0625d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (c + (a / (-4.0 / b))) + ((x * y) + (t * (z * 0.0625)));
}
def code(x, y, z, t, a, b, c): return (c + (a / (-4.0 / b))) + ((x * y) + (t * (z * 0.0625)))
function code(x, y, z, t, a, b, c) return Float64(Float64(c + Float64(a / Float64(-4.0 / b))) + Float64(Float64(x * y) + Float64(t * Float64(z * 0.0625)))) end
function tmp = code(x, y, z, t, a, b, c) tmp = (c + (a / (-4.0 / b))) + ((x * y) + (t * (z * 0.0625))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(c + \frac{a}{\frac{-4}{b}}\right) + \left(x \cdot y + t \cdot \left(z \cdot 0.0625\right)\right)
\end{array}
Initial program 98.1%
sub-neg98.1%
associate-+l+98.1%
fma-def98.9%
associate-*l/98.9%
distribute-frac-neg98.9%
distribute-rgt-neg-out98.9%
associate-/l*99.2%
neg-mul-199.2%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
fma-udef98.4%
*-commutative98.4%
div-inv98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* 0.25 (* a b)))))
(if (<= x -9e+97)
t_1
(if (<= x -6.8e-279)
(+ c (* 0.0625 (* z t)))
(if (<= x 7.8e-29) (+ 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 = (x * y) - (0.25 * (a * b));
double tmp;
if (x <= -9e+97) {
tmp = t_1;
} else if (x <= -6.8e-279) {
tmp = c + (0.0625 * (z * t));
} else if (x <= 7.8e-29) {
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 = (x * y) - (0.25d0 * (a * b))
if (x <= (-9d+97)) then
tmp = t_1
else if (x <= (-6.8d-279)) then
tmp = c + (0.0625d0 * (z * t))
else if (x <= 7.8d-29) 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 = (x * y) - (0.25 * (a * b));
double tmp;
if (x <= -9e+97) {
tmp = t_1;
} else if (x <= -6.8e-279) {
tmp = c + (0.0625 * (z * t));
} else if (x <= 7.8e-29) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - (0.25 * (a * b)) tmp = 0 if x <= -9e+97: tmp = t_1 elif x <= -6.8e-279: tmp = c + (0.0625 * (z * t)) elif x <= 7.8e-29: tmp = c + (a * (b * -0.25)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(0.25 * Float64(a * b))) tmp = 0.0 if (x <= -9e+97) tmp = t_1; elseif (x <= -6.8e-279) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (x <= 7.8e-29) 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 = (x * y) - (0.25 * (a * b)); tmp = 0.0; if (x <= -9e+97) tmp = t_1; elseif (x <= -6.8e-279) tmp = c + (0.0625 * (z * t)); elseif (x <= 7.8e-29) 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[(N[(x * y), $MachinePrecision] - N[(0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+97], t$95$1, If[LessEqual[x, -6.8e-279], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8e-29], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - 0.25 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-279}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-29}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.99999999999999952e97 or 7.7999999999999995e-29 < x Initial program 95.6%
Taylor expanded in z around 0 83.3%
Taylor expanded in c around 0 70.1%
if -8.99999999999999952e97 < x < -6.8000000000000003e-279Initial program 100.0%
Taylor expanded in x around 0 89.7%
Taylor expanded in a around 0 65.7%
if -6.8000000000000003e-279 < x < 7.7999999999999995e-29Initial program 99.9%
Taylor expanded in a around inf 69.3%
*-commutative69.3%
associate-*r*69.3%
Simplified69.3%
Final simplification68.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -6.5e+75) (not (<= (* x y) 3.1e+170))) (+ c (* x y)) (+ c (* 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) <= -6.5e+75) || !((x * y) <= 3.1e+170)) {
tmp = c + (x * y);
} else {
tmp = c + (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) <= (-6.5d+75)) .or. (.not. ((x * y) <= 3.1d+170))) then
tmp = c + (x * y)
else
tmp = c + (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) <= -6.5e+75) || !((x * y) <= 3.1e+170)) {
tmp = c + (x * y);
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -6.5e+75) or not ((x * y) <= 3.1e+170): tmp = c + (x * y) else: tmp = c + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -6.5e+75) || !(Float64(x * y) <= 3.1e+170)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + 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) <= -6.5e+75) || ~(((x * y) <= 3.1e+170))) tmp = c + (x * y); else tmp = c + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -6.5e+75], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.1e+170]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+75} \lor \neg \left(x \cdot y \leq 3.1 \cdot 10^{+170}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -6.4999999999999998e75 or 3.1e170 < (*.f64 x y) Initial program 94.7%
Taylor expanded in z around 0 93.6%
Taylor expanded in a around 0 83.0%
if -6.4999999999999998e75 < (*.f64 x y) < 3.1e170Initial program 99.5%
Taylor expanded in x around 0 94.9%
Taylor expanded in a around 0 63.8%
Final simplification69.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* t (* z 0.0625))))
(if (<= t -5.8e-114)
t_2
(if (<= t 6.5e-278)
t_1
(if (<= t 3e-240) (* a (* b -0.25)) (if (<= t 8.2e+222) 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 (t <= -5.8e-114) {
tmp = t_2;
} else if (t <= 6.5e-278) {
tmp = t_1;
} else if (t <= 3e-240) {
tmp = a * (b * -0.25);
} else if (t <= 8.2e+222) {
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 (t <= (-5.8d-114)) then
tmp = t_2
else if (t <= 6.5d-278) then
tmp = t_1
else if (t <= 3d-240) then
tmp = a * (b * (-0.25d0))
else if (t <= 8.2d+222) 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 (t <= -5.8e-114) {
tmp = t_2;
} else if (t <= 6.5e-278) {
tmp = t_1;
} else if (t <= 3e-240) {
tmp = a * (b * -0.25);
} else if (t <= 8.2e+222) {
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 t <= -5.8e-114: tmp = t_2 elif t <= 6.5e-278: tmp = t_1 elif t <= 3e-240: tmp = a * (b * -0.25) elif t <= 8.2e+222: 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 (t <= -5.8e-114) tmp = t_2; elseif (t <= 6.5e-278) tmp = t_1; elseif (t <= 3e-240) tmp = Float64(a * Float64(b * -0.25)); elseif (t <= 8.2e+222) 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 (t <= -5.8e-114) tmp = t_2; elseif (t <= 6.5e-278) tmp = t_1; elseif (t <= 3e-240) tmp = a * (b * -0.25); elseif (t <= 8.2e+222) 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[t, -5.8e-114], t$95$2, If[LessEqual[t, 6.5e-278], t$95$1, If[LessEqual[t, 3e-240], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e+222], 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}\;t \leq -5.8 \cdot 10^{-114}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-278}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-240}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+222}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.79999999999999993e-114 or 8.19999999999999974e222 < t Initial program 97.1%
Taylor expanded in x around 0 78.4%
Taylor expanded in a around 0 78.4%
+-commutative78.4%
*-commutative78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*r*78.4%
associate-+r+78.4%
associate-*r*78.4%
*-commutative78.4%
fma-udef78.4%
fma-def78.4%
fma-udef78.4%
associate-*r*78.4%
fma-udef78.4%
Simplified78.4%
Taylor expanded in t around inf 47.5%
associate-*r*47.5%
*-commutative47.5%
associate-*l*47.5%
Simplified47.5%
if -5.79999999999999993e-114 < t < 6.5e-278 or 2.99999999999999991e-240 < t < 8.19999999999999974e222Initial program 98.7%
Taylor expanded in z around 0 82.5%
Taylor expanded in a around 0 54.2%
if 6.5e-278 < t < 2.99999999999999991e-240Initial program 100.0%
sub-neg100.0%
associate-+l+100.0%
fma-def100.0%
associate-*l/100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
associate-/l*100.0%
neg-mul-1100.0%
associate-/r*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
*-commutative100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 80.5%
associate-*r*80.5%
*-commutative80.5%
associate-*l*80.5%
Simplified80.5%
Final simplification52.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= x -4.2e+112)
t_1
(if (<= x -1.25e-278)
(+ c (* 0.0625 (* z t)))
(if (<= x 5e-5) (+ 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 <= -4.2e+112) {
tmp = t_1;
} else if (x <= -1.25e-278) {
tmp = c + (0.0625 * (z * t));
} else if (x <= 5e-5) {
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 <= (-4.2d+112)) then
tmp = t_1
else if (x <= (-1.25d-278)) then
tmp = c + (0.0625d0 * (z * t))
else if (x <= 5d-5) 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 <= -4.2e+112) {
tmp = t_1;
} else if (x <= -1.25e-278) {
tmp = c + (0.0625 * (z * t));
} else if (x <= 5e-5) {
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 <= -4.2e+112: tmp = t_1 elif x <= -1.25e-278: tmp = c + (0.0625 * (z * t)) elif x <= 5e-5: 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 (x <= -4.2e+112) tmp = t_1; elseif (x <= -1.25e-278) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (x <= 5e-5) 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 <= -4.2e+112) tmp = t_1; elseif (x <= -1.25e-278) tmp = c + (0.0625 * (z * t)); elseif (x <= 5e-5) 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[x, -4.2e+112], t$95$1, If[LessEqual[x, -1.25e-278], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-5], 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 \leq -4.2 \cdot 10^{+112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-278}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.1999999999999998e112 or 5.00000000000000024e-5 < x Initial program 96.2%
Taylor expanded in z around 0 83.7%
Taylor expanded in a around 0 65.4%
if -4.1999999999999998e112 < x < -1.24999999999999996e-278Initial program 98.9%
Taylor expanded in x around 0 87.9%
Taylor expanded in a around 0 63.8%
if -1.24999999999999996e-278 < x < 5.00000000000000024e-5Initial program 100.0%
Taylor expanded in a around inf 67.2%
*-commutative67.2%
associate-*r*67.2%
Simplified67.2%
Final simplification65.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -1.9e+112)
(* x y)
(if (<= x -5.1e-256)
(* t (* z 0.0625))
(if (<= x 0.00011) (* 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 <= -1.9e+112) {
tmp = x * y;
} else if (x <= -5.1e-256) {
tmp = t * (z * 0.0625);
} else if (x <= 0.00011) {
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 <= (-1.9d+112)) then
tmp = x * y
else if (x <= (-5.1d-256)) then
tmp = t * (z * 0.0625d0)
else if (x <= 0.00011d0) 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 <= -1.9e+112) {
tmp = x * y;
} else if (x <= -5.1e-256) {
tmp = t * (z * 0.0625);
} else if (x <= 0.00011) {
tmp = a * (b * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -1.9e+112: tmp = x * y elif x <= -5.1e-256: tmp = t * (z * 0.0625) elif x <= 0.00011: tmp = a * (b * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -1.9e+112) tmp = Float64(x * y); elseif (x <= -5.1e-256) tmp = Float64(t * Float64(z * 0.0625)); elseif (x <= 0.00011) 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 <= -1.9e+112) tmp = x * y; elseif (x <= -5.1e-256) tmp = t * (z * 0.0625); elseif (x <= 0.00011) tmp = a * (b * -0.25); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -1.9e+112], N[(x * y), $MachinePrecision], If[LessEqual[x, -5.1e-256], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00011], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+112}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{-256}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \leq 0.00011:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -1.90000000000000004e112 or 1.10000000000000004e-4 < x Initial program 96.2%
Taylor expanded in z around 0 83.7%
Taylor expanded in c around 0 69.3%
Taylor expanded in x around inf 51.7%
if -1.90000000000000004e112 < x < -5.10000000000000011e-256Initial program 98.8%
Taylor expanded in x around 0 86.5%
Taylor expanded in a around 0 86.5%
+-commutative86.5%
*-commutative86.5%
associate-*r*86.5%
*-commutative86.5%
associate-*r*86.5%
associate-+r+86.5%
associate-*r*86.5%
*-commutative86.5%
fma-udef86.5%
fma-def86.5%
fma-udef86.5%
associate-*r*86.5%
fma-udef86.5%
Simplified86.5%
Taylor expanded in t around inf 40.1%
associate-*r*40.1%
*-commutative40.1%
associate-*l*40.1%
Simplified40.1%
if -5.10000000000000011e-256 < x < 1.10000000000000004e-4Initial program 100.0%
sub-neg100.0%
associate-+l+100.0%
fma-def100.0%
associate-*l/100.0%
distribute-frac-neg100.0%
distribute-rgt-neg-out100.0%
associate-/l*100.0%
neg-mul-1100.0%
associate-/r*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef99.9%
*-commutative99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 39.9%
associate-*r*39.9%
*-commutative39.9%
associate-*l*39.9%
Simplified39.9%
Final simplification44.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.4e+130) (not (<= (* x y) 6e-43))) (* 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.4e+130) || !((x * y) <= 6e-43)) {
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.4d+130)) .or. (.not. ((x * y) <= 6d-43))) 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.4e+130) || !((x * y) <= 6e-43)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.4e+130) or not ((x * y) <= 6e-43): 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.4e+130) || !(Float64(x * y) <= 6e-43)) 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.4e+130) || ~(((x * y) <= 6e-43))) 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.4e+130], N[Not[LessEqual[N[(x * y), $MachinePrecision], 6e-43]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.4 \cdot 10^{+130} \lor \neg \left(x \cdot y \leq 6 \cdot 10^{-43}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.40000000000000024e130 or 6.00000000000000007e-43 < (*.f64 x y) Initial program 95.2%
Taylor expanded in z around 0 80.6%
Taylor expanded in c around 0 75.5%
Taylor expanded in x around inf 62.8%
if -2.40000000000000024e130 < (*.f64 x y) < 6.00000000000000007e-43Initial program 100.0%
Taylor expanded in c around inf 31.4%
Final simplification43.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 98.1%
Taylor expanded in c around inf 21.5%
Final simplification21.5%
herbie shell --seed 2023310
(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))