
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
(if (<= t_1 INFINITY)
(+ c t_1)
(+ c (* t (+ (* z 0.0625) (/ (* x y) t)))))))
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 = c + (t * ((z * 0.0625) + ((x * y) / t)));
}
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 = c + (t * ((z * 0.0625) + ((x * y) / t)));
}
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 = c + (t * ((z * 0.0625) + ((x * y) / t))) 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(c + Float64(t * Float64(Float64(z * 0.0625) + Float64(Float64(x * y) / t)))); 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 = c + (t * ((z * 0.0625) + ((x * y) / t))); 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[(c + N[(t * N[(N[(z * 0.0625), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625 + \frac{x \cdot y}{t}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in a around 0 42.9%
Taylor expanded in t around inf 71.4%
Final simplification98.9%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma 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 fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 96.9%
associate--l+96.9%
fma-define97.7%
associate-/l*97.7%
fma-neg97.7%
distribute-neg-frac297.7%
metadata-eval97.7%
Simplified97.7%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
*-commutative96.9%
associate-+l-96.9%
fma-define97.3%
*-commutative97.3%
associate-/l*97.3%
associate-/l*97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -5e+26)
(* x y)
(if (<= (* x y) 2e-227)
c
(if (<= (* x y) 2e-93)
(* a (* b -0.25))
(if (<= (* x y) 2e+107) c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -5e+26) {
tmp = x * y;
} else if ((x * y) <= 2e-227) {
tmp = c;
} else if ((x * y) <= 2e-93) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 2e+107) {
tmp = c;
} 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) <= (-5d+26)) then
tmp = x * y
else if ((x * y) <= 2d-227) then
tmp = c
else if ((x * y) <= 2d-93) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 2d+107) then
tmp = c
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) <= -5e+26) {
tmp = x * y;
} else if ((x * y) <= 2e-227) {
tmp = c;
} else if ((x * y) <= 2e-93) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 2e+107) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -5e+26: tmp = x * y elif (x * y) <= 2e-227: tmp = c elif (x * y) <= 2e-93: tmp = a * (b * -0.25) elif (x * y) <= 2e+107: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -5e+26) tmp = Float64(x * y); elseif (Float64(x * y) <= 2e-227) tmp = c; elseif (Float64(x * y) <= 2e-93) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 2e+107) tmp = c; 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) <= -5e+26) tmp = x * y; elseif ((x * y) <= 2e-227) tmp = c; elseif ((x * y) <= 2e-93) tmp = a * (b * -0.25); elseif ((x * y) <= 2e+107) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+26], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-227], c, If[LessEqual[N[(x * y), $MachinePrecision], 2e-93], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+107], c, N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+26}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-227}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-93}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+107}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e26 or 1.9999999999999999e107 < (*.f64 x y) Initial program 93.9%
Taylor expanded in a around 0 83.7%
Taylor expanded in t around 0 68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in x around inf 65.1%
if -5.0000000000000001e26 < (*.f64 x y) < 1.99999999999999989e-227 or 1.9999999999999998e-93 < (*.f64 x y) < 1.9999999999999999e107Initial program 98.6%
Taylor expanded in c around inf 37.2%
if 1.99999999999999989e-227 < (*.f64 x y) < 1.9999999999999998e-93Initial program 100.0%
Taylor expanded in x around 0 95.7%
Taylor expanded in a around inf 91.6%
Taylor expanded in a around inf 65.0%
Final simplification50.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+75)
(+ c (* a (- (/ (* x y) a) (* b 0.25))))
(if (<= (* a b) 5e+110)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(* a (- (+ (* 0.0625 (/ (* z t) a)) (/ c a)) (* b 0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+75) {
tmp = c + (a * (((x * y) / a) - (b * 0.25)));
} else if ((a * b) <= 5e+110) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = a * (((0.0625 * ((z * t) / a)) + (c / a)) - (b * 0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-2d+75)) then
tmp = c + (a * (((x * y) / a) - (b * 0.25d0)))
else if ((a * b) <= 5d+110) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = a * (((0.0625d0 * ((z * t) / a)) + (c / a)) - (b * 0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+75) {
tmp = c + (a * (((x * y) / a) - (b * 0.25)));
} else if ((a * b) <= 5e+110) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = a * (((0.0625 * ((z * t) / a)) + (c / a)) - (b * 0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2e+75: tmp = c + (a * (((x * y) / a) - (b * 0.25))) elif (a * b) <= 5e+110: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = a * (((0.0625 * ((z * t) / a)) + (c / a)) - (b * 0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+75) tmp = Float64(c + Float64(a * Float64(Float64(Float64(x * y) / a) - Float64(b * 0.25)))); elseif (Float64(a * b) <= 5e+110) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(a * Float64(Float64(Float64(0.0625 * Float64(Float64(z * t) / a)) + Float64(c / a)) - Float64(b * 0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -2e+75) tmp = c + (a * (((x * y) / a) - (b * 0.25))); elseif ((a * b) <= 5e+110) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = a * (((0.0625 * ((z * t) / a)) + (c / a)) - (b * 0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+75], N[(c + N[(a * N[(N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision] - N[(b * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+110], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(N[(0.0625 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] + N[(c / a), $MachinePrecision]), $MachinePrecision] - N[(b * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+75}:\\
\;\;\;\;c + a \cdot \left(\frac{x \cdot y}{a} - b \cdot 0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+110}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(0.0625 \cdot \frac{z \cdot t}{a} + \frac{c}{a}\right) - b \cdot 0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999985e75Initial program 96.1%
Taylor expanded in a around inf 96.2%
Taylor expanded in t around 0 86.9%
if -1.99999999999999985e75 < (*.f64 a b) < 4.99999999999999978e110Initial program 98.8%
Taylor expanded in a around 0 95.4%
if 4.99999999999999978e110 < (*.f64 a b) Initial program 90.7%
Taylor expanded in x around 0 77.7%
Taylor expanded in a around inf 86.7%
Final simplification92.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -1e+106)
t_1
(if (<= (* x y) 2e-238)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 2e+107) (+ 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) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -1e+106) {
tmp = t_1;
} else if ((x * y) <= 2e-238) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 2e+107) {
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) - ((a * b) * 0.25d0)
if ((x * y) <= (-1d+106)) then
tmp = t_1
else if ((x * y) <= 2d-238) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 2d+107) 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) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -1e+106) {
tmp = t_1;
} else if ((x * y) <= 2e-238) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 2e+107) {
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) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -1e+106: tmp = t_1 elif (x * y) <= 2e-238: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 2e+107: 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(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -1e+106) tmp = t_1; elseif (Float64(x * y) <= 2e-238) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 2e+107) 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) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -1e+106) tmp = t_1; elseif ((x * y) <= 2e-238) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 2e+107) 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[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+106], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-238], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+107], 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 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-238}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+107}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000009e106 or 1.9999999999999999e107 < (*.f64 x y) Initial program 93.4%
Taylor expanded in z around 0 85.7%
Taylor expanded in c around 0 85.7%
if -1.00000000000000009e106 < (*.f64 x y) < 2e-238Initial program 97.3%
Taylor expanded in a around 0 77.2%
Taylor expanded in t around inf 67.0%
associate-*r*67.0%
*-commutative67.0%
associate-*r*67.0%
Simplified67.0%
if 2e-238 < (*.f64 x y) < 1.9999999999999999e107Initial program 100.0%
associate--l+100.0%
fma-define100.0%
associate-/l*100.0%
fma-neg100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 68.4%
*-commutative68.4%
associate-*r*68.4%
Simplified68.4%
Final simplification72.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -1e+155)
t_1
(if (<= (* x y) 2e-238)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 2e+75) (+ c (* a (* b -0.25))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1e+155) {
tmp = t_1;
} else if ((x * y) <= 2e-238) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 2e+75) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-1d+155)) then
tmp = t_1
else if ((x * y) <= 2d-238) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 2d+75) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1e+155) {
tmp = t_1;
} else if ((x * y) <= 2e-238) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 2e+75) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -1e+155: tmp = t_1 elif (x * y) <= 2e-238: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 2e+75: tmp = c + (a * (b * -0.25)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+155) tmp = t_1; elseif (Float64(x * y) <= 2e-238) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 2e+75) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+155) tmp = t_1; elseif ((x * y) <= 2e-238) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 2e+75) tmp = c + (a * (b * -0.25)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+155], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-238], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+75], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-238}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+75}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000001e155 or 1.99999999999999985e75 < (*.f64 x y) Initial program 93.9%
Taylor expanded in a around 0 86.9%
Taylor expanded in t around 0 79.7%
+-commutative79.7%
Simplified79.7%
if -1.00000000000000001e155 < (*.f64 x y) < 2e-238Initial program 97.4%
Taylor expanded in a around 0 76.0%
Taylor expanded in t around inf 66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r*66.1%
Simplified66.1%
if 2e-238 < (*.f64 x y) < 1.99999999999999985e75Initial program 100.0%
associate--l+100.0%
fma-define100.0%
associate-/l*100.0%
fma-neg100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 69.9%
*-commutative69.9%
associate-*r*69.9%
Simplified69.9%
Final simplification71.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+75) (not (<= (* a b) 5e+161))) (+ c (* a (- (/ (* 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) <= -2e+75) || !((a * b) <= 5e+161)) {
tmp = c + (a * (((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) <= (-2d+75)) .or. (.not. ((a * b) <= 5d+161))) then
tmp = c + (a * (((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) <= -2e+75) || !((a * b) <= 5e+161)) {
tmp = c + (a * (((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) <= -2e+75) or not ((a * b) <= 5e+161): tmp = c + (a * (((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) <= -2e+75) || !(Float64(a * b) <= 5e+161)) tmp = Float64(c + Float64(a * Float64(Float64(Float64(x * y) / a) - Float64(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) <= -2e+75) || ~(((a * b) <= 5e+161))) tmp = c + (a * (((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], -2e+75], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+161]], $MachinePrecision]], N[(c + N[(a * N[(N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision] - N[(b * 0.25), $MachinePrecision]), $MachinePrecision]), $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 -2 \cdot 10^{+75} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+161}\right):\\
\;\;\;\;c + a \cdot \left(\frac{x \cdot y}{a} - b \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999985e75 or 4.9999999999999997e161 < (*.f64 a b) Initial program 92.6%
Taylor expanded in a around inf 96.2%
Taylor expanded in t around 0 87.6%
if -1.99999999999999985e75 < (*.f64 a b) < 4.9999999999999997e161Initial program 98.9%
Taylor expanded in a around 0 93.9%
Final simplification92.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -1e+63)
(- (+ c (* x y)) (* (* a b) 0.25))
(if (<= (* a b) 1e+259)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+63) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+259) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-1d+63)) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else if ((a * b) <= 1d+259) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (a * (b * (-0.25d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+63) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+259) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+63: tmp = (c + (x * y)) - ((a * b) * 0.25) elif (a * b) <= 1e+259: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+63) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 1e+259) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -1e+63) tmp = (c + (x * y)) - ((a * b) * 0.25); elseif ((a * b) <= 1e+259) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+63], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+259], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+63}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 10^{+259}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000006e63Initial program 96.2%
Taylor expanded in z around 0 86.8%
if -1.00000000000000006e63 < (*.f64 a b) < 9.999999999999999e258Initial program 98.9%
Taylor expanded in a around 0 93.1%
if 9.999999999999999e258 < (*.f64 a b) Initial program 80.9%
associate--l+80.9%
fma-define85.9%
associate-/l*85.9%
fma-neg85.9%
distribute-neg-frac285.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
associate-*r*90.0%
Simplified90.0%
Final simplification91.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -1e+111)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 1e+259)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+111) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+259) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-1d+111)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 1d+259) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (a * (b * (-0.25d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+111) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+259) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+111: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 1e+259: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+111) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 1e+259) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -1e+111) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 1e+259) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+111], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+259], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+111}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 10^{+259}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999957e110Initial program 95.5%
Taylor expanded in z around 0 86.9%
Taylor expanded in c around 0 79.3%
if -9.99999999999999957e110 < (*.f64 a b) < 9.999999999999999e258Initial program 98.9%
Taylor expanded in a around 0 91.9%
if 9.999999999999999e258 < (*.f64 a b) Initial program 80.9%
associate--l+80.9%
fma-define85.9%
associate-/l*85.9%
fma-neg85.9%
distribute-neg-frac285.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
associate-*r*90.0%
Simplified90.0%
Final simplification89.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+155) (not (<= (* x y) 2e+75))) (+ c (* x y)) (+ c (* t (* z 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1e+155) || !((x * y) <= 2e+75)) {
tmp = c + (x * y);
} else {
tmp = c + (t * (z * 0.0625));
}
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) <= (-1d+155)) .or. (.not. ((x * y) <= 2d+75))) then
tmp = c + (x * y)
else
tmp = c + (t * (z * 0.0625d0))
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) <= -1e+155) || !((x * y) <= 2e+75)) {
tmp = c + (x * y);
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1e+155) or not ((x * y) <= 2e+75): tmp = c + (x * y) else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1e+155) || !(Float64(x * y) <= 2e+75)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1e+155) || ~(((x * y) <= 2e+75))) tmp = c + (x * y); else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+155], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+75]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+155} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+75}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000001e155 or 1.99999999999999985e75 < (*.f64 x y) Initial program 93.9%
Taylor expanded in a around 0 86.9%
Taylor expanded in t around 0 79.7%
+-commutative79.7%
Simplified79.7%
if -1.00000000000000001e155 < (*.f64 x y) < 1.99999999999999985e75Initial program 98.4%
Taylor expanded in a around 0 70.6%
Taylor expanded in t around inf 61.6%
associate-*r*61.6%
*-commutative61.6%
associate-*r*61.6%
Simplified61.6%
Final simplification67.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -5.8e+26) (not (<= (* x y) 9e+108))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -5.8e+26) || !((x * y) <= 9e+108)) {
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) <= (-5.8d+26)) .or. (.not. ((x * y) <= 9d+108))) 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) <= -5.8e+26) || !((x * y) <= 9e+108)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -5.8e+26) or not ((x * y) <= 9e+108): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -5.8e+26) || !(Float64(x * y) <= 9e+108)) 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) <= -5.8e+26) || ~(((x * y) <= 9e+108))) 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], -5.8e+26], N[Not[LessEqual[N[(x * y), $MachinePrecision], 9e+108]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+26} \lor \neg \left(x \cdot y \leq 9 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -5.8e26 or 9e108 < (*.f64 x y) Initial program 93.9%
Taylor expanded in a around 0 83.7%
Taylor expanded in t around 0 68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in x around inf 65.1%
if -5.8e26 < (*.f64 x y) < 9e108Initial program 98.8%
Taylor expanded in c around inf 33.6%
Final simplification45.7%
(FPCore (x y z t a b c) :precision binary64 (if (<= b 3e+197) (+ c (* x y)) (* a (* b -0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= 3e+197) {
tmp = c + (x * y);
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3d+197) then
tmp = c + (x * y)
else
tmp = a * (b * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= 3e+197) {
tmp = c + (x * y);
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= 3e+197: tmp = c + (x * y) else: tmp = a * (b * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= 3e+197) tmp = Float64(c + Float64(x * y)); else tmp = Float64(a * Float64(b * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= 3e+197) tmp = c + (x * y); else tmp = a * (b * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, 3e+197], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{+197}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if b < 3.0000000000000002e197Initial program 97.0%
Taylor expanded in a around 0 78.9%
Taylor expanded in t around 0 54.4%
+-commutative54.4%
Simplified54.4%
if 3.0000000000000002e197 < b Initial program 96.2%
Taylor expanded in x around 0 81.4%
Taylor expanded in a around inf 77.8%
Taylor expanded in a around inf 51.5%
Final simplification54.1%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in c around inf 23.0%
herbie shell --seed 2024139
(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))