
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma z (/ 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 98.0%
associate--l+98.0%
fma-define98.8%
associate-/l*98.8%
fma-neg98.8%
distribute-neg-frac298.8%
metadata-eval98.8%
Simplified98.8%
(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 98.0%
associate-+l-98.0%
*-commutative98.0%
associate-+l-98.0%
fma-define98.4%
*-commutative98.4%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* z t)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -200000000000.0)
t_2
(if (<= (* x y) -5e-138)
t_1
(if (<= (* x y) 2e-283)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 4e+173) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -200000000000.0) {
tmp = t_2;
} else if ((x * y) <= -5e-138) {
tmp = t_1;
} else if ((x * y) <= 2e-283) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+173) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (0.0625d0 * (z * t))
t_2 = c + (x * y)
if ((x * y) <= (-200000000000.0d0)) then
tmp = t_2
else if ((x * y) <= (-5d-138)) then
tmp = t_1
else if ((x * y) <= 2d-283) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 4d+173) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -200000000000.0) {
tmp = t_2;
} else if ((x * y) <= -5e-138) {
tmp = t_1;
} else if ((x * y) <= 2e-283) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+173) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (z * t)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -200000000000.0: tmp = t_2 elif (x * y) <= -5e-138: tmp = t_1 elif (x * y) <= 2e-283: tmp = c + (a * (b * -0.25)) elif (x * y) <= 4e+173: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(z * t))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -200000000000.0) tmp = t_2; elseif (Float64(x * y) <= -5e-138) tmp = t_1; elseif (Float64(x * y) <= 2e-283) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 4e+173) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (0.0625 * (z * t)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -200000000000.0) tmp = t_2; elseif ((x * y) <= -5e-138) tmp = t_1; elseif ((x * y) <= 2e-283) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 4e+173) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -200000000000.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e-138], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-283], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+173], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -200000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-283}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2e11 or 4.0000000000000001e173 < (*.f64 x y) Initial program 95.9%
Taylor expanded in a around 0 83.3%
Taylor expanded in t around 0 77.6%
if -2e11 < (*.f64 x y) < -4.99999999999999989e-138 or 1.99999999999999989e-283 < (*.f64 x y) < 4.0000000000000001e173Initial program 98.9%
Taylor expanded in a around 0 78.8%
Taylor expanded in t around inf 71.1%
if -4.99999999999999989e-138 < (*.f64 x y) < 1.99999999999999989e-283Initial 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 76.9%
*-commutative76.9%
associate-*r*76.9%
Simplified76.9%
Final simplification75.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= y -4.3e-73)
(* x y)
(if (<= y -3.3e-268)
t_1
(if (<= y 2.4e-138)
c
(if (<= y 1.42e-34)
t_1
(if (<= y 2.2e+110) (* b (* a -0.25)) (* x y))))))))
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 (y <= -4.3e-73) {
tmp = x * y;
} else if (y <= -3.3e-268) {
tmp = t_1;
} else if (y <= 2.4e-138) {
tmp = c;
} else if (y <= 1.42e-34) {
tmp = t_1;
} else if (y <= 2.2e+110) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (y <= (-4.3d-73)) then
tmp = x * y
else if (y <= (-3.3d-268)) then
tmp = t_1
else if (y <= 2.4d-138) then
tmp = c
else if (y <= 1.42d-34) then
tmp = t_1
else if (y <= 2.2d+110) then
tmp = b * (a * (-0.25d0))
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (y <= -4.3e-73) {
tmp = x * y;
} else if (y <= -3.3e-268) {
tmp = t_1;
} else if (y <= 2.4e-138) {
tmp = c;
} else if (y <= 1.42e-34) {
tmp = t_1;
} else if (y <= 2.2e+110) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if y <= -4.3e-73: tmp = x * y elif y <= -3.3e-268: tmp = t_1 elif y <= 2.4e-138: tmp = c elif y <= 1.42e-34: tmp = t_1 elif y <= 2.2e+110: tmp = b * (a * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (y <= -4.3e-73) tmp = Float64(x * y); elseif (y <= -3.3e-268) tmp = t_1; elseif (y <= 2.4e-138) tmp = c; elseif (y <= 1.42e-34) tmp = t_1; elseif (y <= 2.2e+110) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (y <= -4.3e-73) tmp = x * y; elseif (y <= -3.3e-268) tmp = t_1; elseif (y <= 2.4e-138) tmp = c; elseif (y <= 1.42e-34) tmp = t_1; elseif (y <= 2.2e+110) tmp = b * (a * -0.25); else tmp = x * y; 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[LessEqual[y, -4.3e-73], N[(x * y), $MachinePrecision], If[LessEqual[y, -3.3e-268], t$95$1, If[LessEqual[y, 2.4e-138], c, If[LessEqual[y, 1.42e-34], t$95$1, If[LessEqual[y, 2.2e+110], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{-73}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-268}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-138}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+110}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -4.2999999999999999e-73 or 2.19999999999999992e110 < y Initial program 96.8%
Taylor expanded in a around 0 81.1%
Taylor expanded in y around inf 81.1%
Taylor expanded in c around 0 66.3%
Taylor expanded in x around inf 48.7%
if -4.2999999999999999e-73 < y < -3.29999999999999993e-268 or 2.3999999999999999e-138 < y < 1.42000000000000003e-34Initial program 100.0%
Taylor expanded in a around 0 76.4%
Taylor expanded in t around inf 71.5%
Taylor expanded in c around 0 44.5%
if -3.29999999999999993e-268 < y < 2.3999999999999999e-138Initial program 97.9%
Taylor expanded in c around inf 35.2%
if 1.42000000000000003e-34 < y < 2.19999999999999992e110Initial program 100.0%
Taylor expanded in x around 0 72.9%
Taylor expanded in a around inf 39.6%
*-commutative39.6%
*-commutative39.6%
associate-*l*39.6%
Simplified39.6%
Final simplification44.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -2e-25)
(+ (* x y) t_1)
(if (<= (* x y) 2e-283)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 4e+173) (+ c t_1) (+ c (* x y)))))))
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) <= -2e-25) {
tmp = (x * y) + t_1;
} else if ((x * y) <= 2e-283) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+173) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((x * y) <= (-2d-25)) then
tmp = (x * y) + t_1
else if ((x * y) <= 2d-283) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 4d+173) then
tmp = c + t_1
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -2e-25) {
tmp = (x * y) + t_1;
} else if ((x * y) <= 2e-283) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+173) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -2e-25: tmp = (x * y) + t_1 elif (x * y) <= 2e-283: tmp = c + (a * (b * -0.25)) elif (x * y) <= 4e+173: tmp = c + t_1 else: tmp = c + (x * y) 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) <= -2e-25) tmp = Float64(Float64(x * y) + t_1); elseif (Float64(x * y) <= 2e-283) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 4e+173) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(x * y)); 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) <= -2e-25) tmp = (x * y) + t_1; elseif ((x * y) <= 2e-283) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 4e+173) tmp = c + t_1; else tmp = c + (x * y); 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[LessEqual[N[(x * y), $MachinePrecision], -2e-25], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-283], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+173], N[(c + t$95$1), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y + t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-283}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+173}:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000008e-25Initial program 94.7%
Taylor expanded in a around 0 79.4%
Taylor expanded in y around inf 79.5%
Taylor expanded in c around 0 70.4%
Taylor expanded in y around 0 70.4%
if -2.00000000000000008e-25 < (*.f64 x y) < 1.99999999999999989e-283Initial 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 73.9%
*-commutative73.9%
associate-*r*73.9%
Simplified73.9%
if 1.99999999999999989e-283 < (*.f64 x y) < 4.0000000000000001e173Initial program 98.3%
Taylor expanded in a around 0 76.6%
Taylor expanded in t around inf 70.9%
if 4.0000000000000001e173 < (*.f64 x y) Initial program 100.0%
Taylor expanded in a around 0 94.7%
Taylor expanded in t around 0 89.4%
Final simplification74.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* x y) -5e+24)
(- (+ c (* x y)) t_1)
(if (<= (* x y) 1e+52) (- (+ c t_2) t_1) (+ c (+ (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -5e+24) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 1e+52) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + 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 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((x * y) <= (-5d+24)) then
tmp = (c + (x * y)) - t_1
else if ((x * y) <= 1d+52) then
tmp = (c + t_2) - t_1
else
tmp = c + ((x * y) + 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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -5e+24) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 1e+52) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -5e+24: tmp = (c + (x * y)) - t_1 elif (x * y) <= 1e+52: tmp = (c + t_2) - t_1 else: tmp = c + ((x * y) + t_2) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -5e+24) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(x * y) <= 1e+52) tmp = Float64(Float64(c + t_2) - t_1); else tmp = Float64(c + Float64(Float64(x * y) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -5e+24) tmp = (c + (x * y)) - t_1; elseif ((x * y) <= 1e+52) tmp = (c + t_2) - t_1; else tmp = c + ((x * y) + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+24], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+52], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+24}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+52}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000045e24Initial program 93.4%
Taylor expanded in z around 0 87.3%
if -5.00000000000000045e24 < (*.f64 x y) < 9.9999999999999999e51Initial program 99.3%
Taylor expanded in x around 0 95.6%
if 9.9999999999999999e51 < (*.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 93.9%
Final simplification93.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+64) (not (<= (* a b) 4e+78))) (- (+ 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) <= -2e+64) || !((a * b) <= 4e+78)) {
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) <= (-2d+64)) .or. (.not. ((a * b) <= 4d+78))) 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) <= -2e+64) || !((a * b) <= 4e+78)) {
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) <= -2e+64) or not ((a * b) <= 4e+78): 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) <= -2e+64) || !(Float64(a * b) <= 4e+78)) 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) <= -2e+64) || ~(((a * b) <= 4e+78))) 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], -2e+64], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4e+78]], $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 -2 \cdot 10^{+64} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+78}\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) < -2.00000000000000004e64 or 4.00000000000000003e78 < (*.f64 a b) Initial program 96.9%
Taylor expanded in z around 0 83.2%
if -2.00000000000000004e64 < (*.f64 a b) < 4.00000000000000003e78Initial program 98.7%
Taylor expanded in a around 0 93.6%
Final simplification89.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* a b) -2e+191) (not (<= (* a b) 1e+86)))
(- t_1 (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -2e+191) || !((a * b) <= 1e+86)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((a * b) <= (-2d+191)) .or. (.not. ((a * b) <= 1d+86))) then
tmp = t_1 - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -2e+191) || !((a * b) <= 1e+86)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((a * b) <= -2e+191) or not ((a * b) <= 1e+86): tmp = t_1 - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -2e+191) || !(Float64(a * b) <= 1e+86)) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((a * b) <= -2e+191) || ~(((a * b) <= 1e+86))) tmp = t_1 - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+191], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+86]], $MachinePrecision]], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+191} \lor \neg \left(a \cdot b \leq 10^{+86}\right):\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000015e191 or 1e86 < (*.f64 a b) Initial program 97.5%
Taylor expanded in x around 0 85.7%
Taylor expanded in c around 0 82.0%
if -2.00000000000000015e191 < (*.f64 a b) < 1e86Initial program 98.3%
Taylor expanded in a around 0 91.9%
Final simplification88.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.8e+151) (not (<= a 5.5e+20))) (+ c (* 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 <= -1.8e+151) || !(a <= 5.5e+20)) {
tmp = c + (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 <= (-1.8d+151)) .or. (.not. (a <= 5.5d+20))) then
tmp = c + (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 <= -1.8e+151) || !(a <= 5.5e+20)) {
tmp = c + (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 <= -1.8e+151) or not (a <= 5.5e+20): tmp = c + (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 ((a <= -1.8e+151) || !(a <= 5.5e+20)) tmp = Float64(c + Float64(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 <= -1.8e+151) || ~((a <= 5.5e+20))) tmp = c + (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[a, -1.8e+151], N[Not[LessEqual[a, 5.5e+20]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $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 \leq -1.8 \cdot 10^{+151} \lor \neg \left(a \leq 5.5 \cdot 10^{+20}\right):\\
\;\;\;\;c + a \cdot \left(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 a < -1.8e151 or 5.5e20 < a Initial program 97.8%
associate--l+97.8%
fma-define98.9%
associate-/l*98.9%
fma-neg98.9%
distribute-neg-frac298.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in a around inf 65.2%
*-commutative65.2%
associate-*r*65.2%
Simplified65.2%
if -1.8e151 < a < 5.5e20Initial program 98.2%
Taylor expanded in a around 0 86.5%
Final simplification78.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -200000000000.0) (not (<= (* x y) 4e+173))) (+ 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) <= -200000000000.0) || !((x * y) <= 4e+173)) {
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) <= (-200000000000.0d0)) .or. (.not. ((x * y) <= 4d+173))) 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) <= -200000000000.0) || !((x * y) <= 4e+173)) {
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) <= -200000000000.0) or not ((x * y) <= 4e+173): 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) <= -200000000000.0) || !(Float64(x * y) <= 4e+173)) 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) <= -200000000000.0) || ~(((x * y) <= 4e+173))) 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], -200000000000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4e+173]], $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 -200000000000 \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+173}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e11 or 4.0000000000000001e173 < (*.f64 x y) Initial program 95.9%
Taylor expanded in a around 0 83.3%
Taylor expanded in t around 0 77.6%
if -2e11 < (*.f64 x y) < 4.0000000000000001e173Initial program 99.3%
Taylor expanded in a around 0 71.3%
Taylor expanded in t around inf 66.0%
Final simplification70.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= t -8.5e+26)
t_1
(if (<= t 2.9e+141)
(+ c (* x y))
(if (<= t 2.4e+166) (* b (* a -0.25)) 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 tmp;
if (t <= -8.5e+26) {
tmp = t_1;
} else if (t <= 2.9e+141) {
tmp = c + (x * y);
} else if (t <= 2.4e+166) {
tmp = b * (a * -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 = 0.0625d0 * (z * t)
if (t <= (-8.5d+26)) then
tmp = t_1
else if (t <= 2.9d+141) then
tmp = c + (x * y)
else if (t <= 2.4d+166) then
tmp = b * (a * (-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 = 0.0625 * (z * t);
double tmp;
if (t <= -8.5e+26) {
tmp = t_1;
} else if (t <= 2.9e+141) {
tmp = c + (x * y);
} else if (t <= 2.4e+166) {
tmp = b * (a * -0.25);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if t <= -8.5e+26: tmp = t_1 elif t <= 2.9e+141: tmp = c + (x * y) elif t <= 2.4e+166: tmp = b * (a * -0.25) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (t <= -8.5e+26) tmp = t_1; elseif (t <= 2.9e+141) tmp = Float64(c + Float64(x * y)); elseif (t <= 2.4e+166) tmp = Float64(b * Float64(a * -0.25)); else tmp = t_1; 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 (t <= -8.5e+26) tmp = t_1; elseif (t <= 2.9e+141) tmp = c + (x * y); elseif (t <= 2.4e+166) tmp = b * (a * -0.25); else tmp = 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]}, If[LessEqual[t, -8.5e+26], t$95$1, If[LessEqual[t, 2.9e+141], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+166], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+141}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+166}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.5e26 or 2.39999999999999992e166 < t Initial program 96.7%
Taylor expanded in a around 0 84.3%
Taylor expanded in t around inf 67.2%
Taylor expanded in c around 0 54.5%
if -8.5e26 < t < 2.90000000000000007e141Initial program 98.7%
Taylor expanded in a around 0 72.0%
Taylor expanded in t around 0 58.9%
if 2.90000000000000007e141 < t < 2.39999999999999992e166Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in a around inf 67.5%
*-commutative67.5%
*-commutative67.5%
associate-*l*67.5%
Simplified67.5%
Final simplification57.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= x -7.5e+18) (* x y) (if (<= x 6.2e-290) c (if (<= x 0.065) (* 0.0625 (* z t)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -7.5e+18) {
tmp = x * y;
} else if (x <= 6.2e-290) {
tmp = c;
} else if (x <= 0.065) {
tmp = 0.0625 * (z * t);
} 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 <= (-7.5d+18)) then
tmp = x * y
else if (x <= 6.2d-290) then
tmp = c
else if (x <= 0.065d0) then
tmp = 0.0625d0 * (z * t)
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 <= -7.5e+18) {
tmp = x * y;
} else if (x <= 6.2e-290) {
tmp = c;
} else if (x <= 0.065) {
tmp = 0.0625 * (z * t);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -7.5e+18: tmp = x * y elif x <= 6.2e-290: tmp = c elif x <= 0.065: tmp = 0.0625 * (z * t) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -7.5e+18) tmp = Float64(x * y); elseif (x <= 6.2e-290) tmp = c; elseif (x <= 0.065) tmp = Float64(0.0625 * Float64(z * t)); 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 <= -7.5e+18) tmp = x * y; elseif (x <= 6.2e-290) tmp = c; elseif (x <= 0.065) tmp = 0.0625 * (z * t); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -7.5e+18], N[(x * y), $MachinePrecision], If[LessEqual[x, 6.2e-290], c, If[LessEqual[x, 0.065], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+18}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-290}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \leq 0.065:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -7.5e18 or 0.065000000000000002 < x Initial program 95.9%
Taylor expanded in a around 0 84.1%
Taylor expanded in y around inf 78.7%
Taylor expanded in c around 0 66.6%
Taylor expanded in x around inf 53.5%
if -7.5e18 < x < 6.1999999999999998e-290Initial program 100.0%
Taylor expanded in c around inf 31.3%
if 6.1999999999999998e-290 < x < 0.065000000000000002Initial program 99.9%
Taylor expanded in a around 0 70.5%
Taylor expanded in t around inf 63.7%
Taylor expanded in c around 0 41.4%
Final simplification44.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* 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 + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
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 + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= x -4.6e+18) (not (<= x 9.2e-26))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x <= -4.6e+18) || !(x <= 9.2e-26)) {
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 <= (-4.6d+18)) .or. (.not. (x <= 9.2d-26))) 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 <= -4.6e+18) || !(x <= 9.2e-26)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x <= -4.6e+18) or not (x <= 9.2e-26): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((x <= -4.6e+18) || !(x <= 9.2e-26)) 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 <= -4.6e+18) || ~((x <= 9.2e-26))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[x, -4.6e+18], N[Not[LessEqual[x, 9.2e-26]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+18} \lor \neg \left(x \leq 9.2 \cdot 10^{-26}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if x < -4.6e18 or 9.20000000000000035e-26 < x Initial program 96.0%
Taylor expanded in a around 0 81.6%
Taylor expanded in y around inf 76.4%
Taylor expanded in c around 0 64.1%
Taylor expanded in x around inf 51.5%
if -4.6e18 < x < 9.20000000000000035e-26Initial program 100.0%
Taylor expanded in c around inf 28.7%
Final simplification39.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.0%
Taylor expanded in c around inf 22.6%
herbie shell --seed 2024130
(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))