
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (* x y))))
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 = x * y;
}
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 = x * y;
}
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 = x * y 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(x * y); 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 = x * y; 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[(x * y), $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}:\\
\;\;\;\;x \cdot y\\
\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 z around 0 42.9%
Taylor expanded in c around 0 42.9%
*-commutative42.9%
fma-neg57.1%
distribute-lft-neg-in57.1%
associate-*r*57.1%
metadata-eval57.1%
Applied egg-rr57.1%
Taylor expanded in y around inf 57.4%
Final simplification98.8%
(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.2%
associate-+l-97.2%
associate--l+97.2%
fma-def97.7%
associate-*l/97.7%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*98.0%
distribute-frac-neg98.0%
associate-/r/98.0%
fma-def98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*98.0%
metadata-eval98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (+ (* x y) (fma t (* z 0.0625) (* b (* a -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((x * y) + fma(t, (z * 0.0625), (b * (a * -0.25))));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(x * y) + fma(t, Float64(z * 0.0625), Float64(b * Float64(a * -0.25))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision] + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, b \cdot \left(a \cdot -0.25\right)\right)\right)
\end{array}
Initial program 97.2%
associate--l+97.2%
associate-*l/97.2%
*-commutative97.2%
fma-neg97.6%
div-inv97.6%
metadata-eval97.6%
associate-/l*97.6%
distribute-frac-neg97.6%
metadata-eval97.6%
distribute-neg-frac97.6%
frac-2neg97.6%
associate-/r/97.6%
div-inv97.6%
metadata-eval97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25))))
(t_2 (+ c (* 0.0625 (* z t))))
(t_3 (+ c (* x y))))
(if (<= (* x y) -1.4e+37)
t_3
(if (<= (* x y) -2.15e-179)
t_1
(if (<= (* x y) -2.8e-255)
t_2
(if (<= (* x y) 1.45e+79) t_1 (if (<= (* x y) 3.7e+111) t_2 t_3)))))))
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 + (0.0625 * (z * t));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1.4e+37) {
tmp = t_3;
} else if ((x * y) <= -2.15e-179) {
tmp = t_1;
} else if ((x * y) <= -2.8e-255) {
tmp = t_2;
} else if ((x * y) <= 1.45e+79) {
tmp = t_1;
} else if ((x * y) <= 3.7e+111) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (0.0625d0 * (z * t))
t_3 = c + (x * y)
if ((x * y) <= (-1.4d+37)) then
tmp = t_3
else if ((x * y) <= (-2.15d-179)) then
tmp = t_1
else if ((x * y) <= (-2.8d-255)) then
tmp = t_2
else if ((x * y) <= 1.45d+79) then
tmp = t_1
else if ((x * y) <= 3.7d+111) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (0.0625 * (z * t));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1.4e+37) {
tmp = t_3;
} else if ((x * y) <= -2.15e-179) {
tmp = t_1;
} else if ((x * y) <= -2.8e-255) {
tmp = t_2;
} else if ((x * y) <= 1.45e+79) {
tmp = t_1;
} else if ((x * y) <= 3.7e+111) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (0.0625 * (z * t)) t_3 = c + (x * y) tmp = 0 if (x * y) <= -1.4e+37: tmp = t_3 elif (x * y) <= -2.15e-179: tmp = t_1 elif (x * y) <= -2.8e-255: tmp = t_2 elif (x * y) <= 1.45e+79: tmp = t_1 elif (x * y) <= 3.7e+111: tmp = t_2 else: tmp = t_3 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(0.0625 * Float64(z * t))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.4e+37) tmp = t_3; elseif (Float64(x * y) <= -2.15e-179) tmp = t_1; elseif (Float64(x * y) <= -2.8e-255) tmp = t_2; elseif (Float64(x * y) <= 1.45e+79) tmp = t_1; elseif (Float64(x * y) <= 3.7e+111) tmp = t_2; else tmp = t_3; 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 + (0.0625 * (z * t)); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.4e+37) tmp = t_3; elseif ((x * y) <= -2.15e-179) tmp = t_1; elseif ((x * y) <= -2.8e-255) tmp = t_2; elseif ((x * y) <= 1.45e+79) tmp = t_1; elseif ((x * y) <= 3.7e+111) tmp = t_2; else tmp = t_3; 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.4e+37], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.15e-179], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-255], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.45e+79], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.7e+111], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+37}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -2.15 \cdot 10^{-179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-255}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 1.45 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.7 \cdot 10^{+111}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.3999999999999999e37 or 3.7000000000000003e111 < (*.f64 x y) Initial program 93.8%
Taylor expanded in x around inf 77.9%
if -1.3999999999999999e37 < (*.f64 x y) < -2.15000000000000013e-179 or -2.80000000000000011e-255 < (*.f64 x y) < 1.44999999999999996e79Initial program 99.2%
Taylor expanded in a around inf 66.6%
*-commutative66.6%
associate-*r*66.6%
Simplified66.6%
if -2.15000000000000013e-179 < (*.f64 x y) < -2.80000000000000011e-255 or 1.44999999999999996e79 < (*.f64 x y) < 3.7000000000000003e111Initial program 100.0%
Taylor expanded in z around inf 77.5%
Final simplification72.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25))))
(t_2 (* 0.0625 (* z t)))
(t_3 (+ (* x y) t_2)))
(if (<= (* x y) -1.65e+97)
t_3
(if (<= (* x y) -1.5e-179)
t_1
(if (<= (* x y) -1.25e-253)
(+ c t_2)
(if (<= (* x y) 3.5e+82) t_1 t_3))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = 0.0625 * (z * t);
double t_3 = (x * y) + t_2;
double tmp;
if ((x * y) <= -1.65e+97) {
tmp = t_3;
} else if ((x * y) <= -1.5e-179) {
tmp = t_1;
} else if ((x * y) <= -1.25e-253) {
tmp = c + t_2;
} else if ((x * y) <= 3.5e+82) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = 0.0625d0 * (z * t)
t_3 = (x * y) + t_2
if ((x * y) <= (-1.65d+97)) then
tmp = t_3
else if ((x * y) <= (-1.5d-179)) then
tmp = t_1
else if ((x * y) <= (-1.25d-253)) then
tmp = c + t_2
else if ((x * y) <= 3.5d+82) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = 0.0625 * (z * t);
double t_3 = (x * y) + t_2;
double tmp;
if ((x * y) <= -1.65e+97) {
tmp = t_3;
} else if ((x * y) <= -1.5e-179) {
tmp = t_1;
} else if ((x * y) <= -1.25e-253) {
tmp = c + t_2;
} else if ((x * y) <= 3.5e+82) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = 0.0625 * (z * t) t_3 = (x * y) + t_2 tmp = 0 if (x * y) <= -1.65e+97: tmp = t_3 elif (x * y) <= -1.5e-179: tmp = t_1 elif (x * y) <= -1.25e-253: tmp = c + t_2 elif (x * y) <= 3.5e+82: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(0.0625 * Float64(z * t)) t_3 = Float64(Float64(x * y) + t_2) tmp = 0.0 if (Float64(x * y) <= -1.65e+97) tmp = t_3; elseif (Float64(x * y) <= -1.5e-179) tmp = t_1; elseif (Float64(x * y) <= -1.25e-253) tmp = Float64(c + t_2); elseif (Float64(x * y) <= 3.5e+82) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = 0.0625 * (z * t); t_3 = (x * y) + t_2; tmp = 0.0; if ((x * y) <= -1.65e+97) tmp = t_3; elseif ((x * y) <= -1.5e-179) tmp = t_1; elseif ((x * y) <= -1.25e-253) tmp = c + t_2; elseif ((x * y) <= 3.5e+82) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.65e+97], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e-179], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.25e-253], N[(c + t$95$2), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.5e+82], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := x \cdot y + t_2\\
\mathbf{if}\;x \cdot y \leq -1.65 \cdot 10^{+97}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.25 \cdot 10^{-253}:\\
\;\;\;\;c + t_2\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.6500000000000001e97 or 3.5e82 < (*.f64 x y) Initial program 93.7%
Taylor expanded in a around 0 88.1%
Taylor expanded in c around 0 81.1%
if -1.6500000000000001e97 < (*.f64 x y) < -1.50000000000000003e-179 or -1.24999999999999993e-253 < (*.f64 x y) < 3.5e82Initial program 99.3%
Taylor expanded in a around inf 65.4%
*-commutative65.4%
associate-*r*65.4%
Simplified65.4%
if -1.50000000000000003e-179 < (*.f64 x y) < -1.24999999999999993e-253Initial program 100.0%
Taylor expanded in z around inf 76.9%
Final simplification71.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (- (* x y) (* (* a b) 0.25))))
(if (<= (* a b) -2e+16)
t_2
(if (<= (* a b) -5e-262)
(+ c (* x y))
(if (<= (* a b) 2e-258)
(+ c t_1)
(if (<= (* a b) 5e+75) (+ (* x y) t_1) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -2e+16) {
tmp = t_2;
} else if ((a * b) <= -5e-262) {
tmp = c + (x * y);
} else if ((a * b) <= 2e-258) {
tmp = c + t_1;
} else if ((a * b) <= 5e+75) {
tmp = (x * y) + 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 = 0.0625d0 * (z * t)
t_2 = (x * y) - ((a * b) * 0.25d0)
if ((a * b) <= (-2d+16)) then
tmp = t_2
else if ((a * b) <= (-5d-262)) then
tmp = c + (x * y)
else if ((a * b) <= 2d-258) then
tmp = c + t_1
else if ((a * b) <= 5d+75) then
tmp = (x * y) + 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 = 0.0625 * (z * t);
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -2e+16) {
tmp = t_2;
} else if ((a * b) <= -5e-262) {
tmp = c + (x * y);
} else if ((a * b) <= 2e-258) {
tmp = c + t_1;
} else if ((a * b) <= 5e+75) {
tmp = (x * y) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (x * y) - ((a * b) * 0.25) tmp = 0 if (a * b) <= -2e+16: tmp = t_2 elif (a * b) <= -5e-262: tmp = c + (x * y) elif (a * b) <= 2e-258: tmp = c + t_1 elif (a * b) <= 5e+75: tmp = (x * y) + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(a * b) <= -2e+16) tmp = t_2; elseif (Float64(a * b) <= -5e-262) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e-258) tmp = Float64(c + t_1); elseif (Float64(a * b) <= 5e+75) tmp = Float64(Float64(x * y) + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((a * b) <= -2e+16) tmp = t_2; elseif ((a * b) <= -5e-262) tmp = c + (x * y); elseif ((a * b) <= 2e-258) tmp = c + t_1; elseif ((a * b) <= 5e+75) tmp = (x * y) + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+16], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -5e-262], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e-258], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+75], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+16}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-262}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-258}:\\
\;\;\;\;c + t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+75}:\\
\;\;\;\;x \cdot y + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2e16 or 5.0000000000000002e75 < (*.f64 a b) Initial program 94.1%
Taylor expanded in z around 0 85.4%
Taylor expanded in c around 0 78.6%
if -2e16 < (*.f64 a b) < -4.99999999999999992e-262Initial program 98.0%
Taylor expanded in x around inf 80.5%
if -4.99999999999999992e-262 < (*.f64 a b) < 1.99999999999999991e-258Initial program 100.0%
Taylor expanded in z around inf 76.9%
if 1.99999999999999991e-258 < (*.f64 a b) < 5.0000000000000002e75Initial program 99.9%
Taylor expanded in a around 0 88.4%
Taylor expanded in c around 0 68.6%
Final simplification76.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* x y) -1.35e+41) (not (<= (* x y) 3.9e+121)))
(+ c (+ (* x y) t_1))
(- (+ c t_1) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -1.35e+41) || !((x * y) <= 3.9e+121)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((x * y) <= (-1.35d+41)) .or. (.not. ((x * y) <= 3.9d+121))) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + t_1) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -1.35e+41) || !((x * y) <= 3.9e+121)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((x * y) <= -1.35e+41) or not ((x * y) <= 3.9e+121): tmp = c + ((x * y) + t_1) else: tmp = (c + t_1) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(x * y) <= -1.35e+41) || !(Float64(x * y) <= 3.9e+121)) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((x * y) <= -1.35e+41) || ~(((x * y) <= 3.9e+121))) tmp = c + ((x * y) + t_1); else tmp = (c + t_1) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.35e+41], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.9e+121]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+41} \lor \neg \left(x \cdot y \leq 3.9 \cdot 10^{+121}\right):\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -1.35e41 or 3.89999999999999984e121 < (*.f64 x y) Initial program 93.7%
Taylor expanded in a around 0 88.8%
if -1.35e41 < (*.f64 x y) < 3.89999999999999984e121Initial program 99.4%
Taylor expanded in x around 0 93.3%
Final simplification91.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -1.4e+37)
(* x y)
(if (<= (* x y) 6.5e+76)
(* b (* a -0.25))
(if (<= (* x y) 2.5e+111) (* z (* t 0.0625)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -1.4e+37) {
tmp = x * y;
} else if ((x * y) <= 6.5e+76) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 2.5e+111) {
tmp = z * (t * 0.0625);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-1.4d+37)) then
tmp = x * y
else if ((x * y) <= 6.5d+76) then
tmp = b * (a * (-0.25d0))
else if ((x * y) <= 2.5d+111) then
tmp = z * (t * 0.0625d0)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -1.4e+37) {
tmp = x * y;
} else if ((x * y) <= 6.5e+76) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 2.5e+111) {
tmp = z * (t * 0.0625);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -1.4e+37: tmp = x * y elif (x * y) <= 6.5e+76: tmp = b * (a * -0.25) elif (x * y) <= 2.5e+111: tmp = z * (t * 0.0625) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -1.4e+37) tmp = Float64(x * y); elseif (Float64(x * y) <= 6.5e+76) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(x * y) <= 2.5e+111) tmp = Float64(z * Float64(t * 0.0625)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -1.4e+37) tmp = x * y; elseif ((x * y) <= 6.5e+76) tmp = b * (a * -0.25); elseif ((x * y) <= 2.5e+111) tmp = z * (t * 0.0625); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.4e+37], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+76], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+111], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+76}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+111}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.3999999999999999e37 or 2.4999999999999998e111 < (*.f64 x y) Initial program 93.8%
Taylor expanded in z around 0 86.7%
Taylor expanded in c around 0 76.9%
*-commutative76.9%
fma-neg77.9%
distribute-lft-neg-in77.9%
associate-*r*77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in y around inf 68.0%
if -1.3999999999999999e37 < (*.f64 x y) < 6.5000000000000005e76Initial program 99.3%
Taylor expanded in z around 0 68.6%
Taylor expanded in c around 0 43.7%
Taylor expanded in x around 0 38.9%
associate-*r*38.9%
*-commutative38.9%
Simplified38.9%
if 6.5000000000000005e76 < (*.f64 x y) < 2.4999999999999998e111Initial program 100.0%
Taylor expanded in a around 0 84.7%
Taylor expanded in c around 0 62.4%
Taylor expanded in t around inf 54.7%
associate-*r*54.7%
Simplified54.7%
Final simplification50.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+71) (not (<= (* a b) 4e+81))) (- (* x y) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+71) || !((a * b) <= 4e+81)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-5d+71)) .or. (.not. ((a * b) <= 4d+81))) then
tmp = (x * y) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+71) || !((a * b) <= 4e+81)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+71) or not ((a * b) <= 4e+81): tmp = (x * y) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+71) || !(Float64(a * b) <= 4e+81)) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+71) || ~(((a * b) <= 4e+81))) tmp = (x * y) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+71], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4e+81]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+71} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+81}\right):\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999972e71 or 3.99999999999999969e81 < (*.f64 a b) Initial program 93.6%
Taylor expanded in z around 0 85.4%
Taylor expanded in c around 0 80.9%
if -4.99999999999999972e71 < (*.f64 a b) < 3.99999999999999969e81Initial program 99.3%
Taylor expanded in a around 0 92.3%
Final simplification88.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+35) (not (<= (* a b) 5e+75))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+35) || !((a * b) <= 5e+75)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-1d+35)) .or. (.not. ((a * b) <= 5d+75))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+35) || !((a * b) <= 5e+75)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1e+35) or not ((a * b) <= 5e+75): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1e+35) || !(Float64(a * b) <= 5e+75)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1e+35) || ~(((a * b) <= 5e+75))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+35], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+75]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+35} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+75}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999997e34 or 5.0000000000000002e75 < (*.f64 a b) Initial program 94.0%
Taylor expanded in z around 0 86.1%
if -9.9999999999999997e34 < (*.f64 a b) < 5.0000000000000002e75Initial program 99.3%
Taylor expanded in a around 0 93.2%
Final simplification90.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2e+40) (not (<= (* x y) 1.35e+114))) (+ 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) <= -2e+40) || !((x * y) <= 1.35e+114)) {
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) <= (-2d+40)) .or. (.not. ((x * y) <= 1.35d+114))) 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) <= -2e+40) || !((x * y) <= 1.35e+114)) {
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) <= -2e+40) or not ((x * y) <= 1.35e+114): 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) <= -2e+40) || !(Float64(x * y) <= 1.35e+114)) 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) <= -2e+40) || ~(((x * y) <= 1.35e+114))) 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], -2e+40], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.35e+114]], $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 -2 \cdot 10^{+40} \lor \neg \left(x \cdot y \leq 1.35 \cdot 10^{+114}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000006e40 or 1.35e114 < (*.f64 x y) Initial program 93.8%
Taylor expanded in x around inf 78.6%
if -2.00000000000000006e40 < (*.f64 x y) < 1.35e114Initial program 99.4%
Taylor expanded in z around inf 59.5%
Final simplification66.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.55e+197)
(* z (* t 0.0625))
(if (or (<= z -9.5e-167) (not (<= z -4.5e-216)))
(+ c (* x y))
(* b (* a -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.55e+197) {
tmp = z * (t * 0.0625);
} else if ((z <= -9.5e-167) || !(z <= -4.5e-216)) {
tmp = c + (x * y);
} else {
tmp = b * (a * -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 (z <= (-1.55d+197)) then
tmp = z * (t * 0.0625d0)
else if ((z <= (-9.5d-167)) .or. (.not. (z <= (-4.5d-216)))) then
tmp = c + (x * y)
else
tmp = b * (a * (-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 (z <= -1.55e+197) {
tmp = z * (t * 0.0625);
} else if ((z <= -9.5e-167) || !(z <= -4.5e-216)) {
tmp = c + (x * y);
} else {
tmp = b * (a * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.55e+197: tmp = z * (t * 0.0625) elif (z <= -9.5e-167) or not (z <= -4.5e-216): tmp = c + (x * y) else: tmp = b * (a * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.55e+197) tmp = Float64(z * Float64(t * 0.0625)); elseif ((z <= -9.5e-167) || !(z <= -4.5e-216)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(b * Float64(a * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -1.55e+197) tmp = z * (t * 0.0625); elseif ((z <= -9.5e-167) || ~((z <= -4.5e-216))) tmp = c + (x * y); else tmp = b * (a * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.55e+197], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -9.5e-167], N[Not[LessEqual[z, -4.5e-216]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+197}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-167} \lor \neg \left(z \leq -4.5 \cdot 10^{-216}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if z < -1.55e197Initial program 100.0%
Taylor expanded in a around 0 79.8%
Taylor expanded in c around 0 69.8%
Taylor expanded in t around inf 53.0%
associate-*r*53.0%
Simplified53.0%
if -1.55e197 < z < -9.49999999999999955e-167 or -4.4999999999999999e-216 < z Initial program 96.7%
Taylor expanded in x around inf 51.4%
if -9.49999999999999955e-167 < z < -4.4999999999999999e-216Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in c around 0 78.3%
Taylor expanded in x around 0 51.8%
associate-*r*51.8%
*-commutative51.8%
Simplified51.8%
Final simplification51.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.6e+37) (not (<= (* x y) 3.8e+179))) (* x y) (* b (* a -0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.6e+37) || !((x * y) <= 3.8e+179)) {
tmp = x * y;
} else {
tmp = b * (a * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-1.6d+37)) .or. (.not. ((x * y) <= 3.8d+179))) then
tmp = x * y
else
tmp = b * (a * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.6e+37) || !((x * y) <= 3.8e+179)) {
tmp = x * y;
} else {
tmp = b * (a * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.6e+37) or not ((x * y) <= 3.8e+179): tmp = x * y else: tmp = b * (a * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.6e+37) || !(Float64(x * y) <= 3.8e+179)) tmp = Float64(x * y); else tmp = Float64(b * Float64(a * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.6e+37) || ~(((x * y) <= 3.8e+179))) tmp = x * y; else tmp = b * (a * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.6e+37], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.8e+179]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.6 \cdot 10^{+37} \lor \neg \left(x \cdot y \leq 3.8 \cdot 10^{+179}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.60000000000000007e37 or 3.8e179 < (*.f64 x y) Initial program 93.1%
Taylor expanded in z around 0 87.1%
Taylor expanded in c around 0 78.5%
*-commutative78.5%
fma-neg79.7%
distribute-lft-neg-in79.7%
associate-*r*79.7%
metadata-eval79.7%
Applied egg-rr79.7%
Taylor expanded in y around inf 73.1%
if -1.60000000000000007e37 < (*.f64 x y) < 3.8e179Initial program 99.4%
Taylor expanded in z around 0 67.9%
Taylor expanded in c around 0 43.5%
Taylor expanded in x around 0 36.8%
associate-*r*36.8%
*-commutative36.8%
Simplified36.8%
Final simplification49.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3.4e+114) (not (<= (* x y) 8e+128))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -3.4e+114) || !((x * y) <= 8e+128)) {
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) <= (-3.4d+114)) .or. (.not. ((x * y) <= 8d+128))) 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) <= -3.4e+114) || !((x * y) <= 8e+128)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -3.4e+114) or not ((x * y) <= 8e+128): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -3.4e+114) || !(Float64(x * y) <= 8e+128)) 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) <= -3.4e+114) || ~(((x * y) <= 8e+128))) 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], -3.4e+114], N[Not[LessEqual[N[(x * y), $MachinePrecision], 8e+128]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.4 \cdot 10^{+114} \lor \neg \left(x \cdot y \leq 8 \cdot 10^{+128}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -3.4000000000000001e114 or 8.0000000000000006e128 < (*.f64 x y) Initial program 93.8%
Taylor expanded in z around 0 88.7%
Taylor expanded in c around 0 84.0%
*-commutative84.0%
fma-neg85.2%
distribute-lft-neg-in85.2%
associate-*r*85.2%
metadata-eval85.2%
Applied egg-rr85.2%
Taylor expanded in y around inf 77.3%
if -3.4000000000000001e114 < (*.f64 x y) < 8.0000000000000006e128Initial program 98.8%
Taylor expanded in c around inf 27.4%
Final simplification43.2%
(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.2%
Taylor expanded in c around inf 20.6%
Final simplification20.6%
herbie shell --seed 2024018
(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))