
(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 17 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.4%
associate--l+98.4%
fma-define99.6%
associate-/l*99.6%
fma-neg99.6%
distribute-neg-frac299.6%
metadata-eval99.6%
Simplified99.6%
(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.4%
associate-+l-98.4%
*-commutative98.4%
associate-+l-98.4%
fma-define99.2%
*-commutative99.2%
associate-/l*99.2%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* a b) -5000000000.0)
(- (+ c t_1) (* (* a b) 0.25))
(if (<= (* a b) 1e+121)
(+ c (+ (* x y) t_1))
(+ c (* b (- (/ (* z (* t 0.0625)) b) (* a 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 ((a * b) <= -5000000000.0) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+121) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + (b * (((z * (t * 0.0625)) / 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) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((a * b) <= (-5000000000.0d0)) then
tmp = (c + t_1) - ((a * b) * 0.25d0)
else if ((a * b) <= 1d+121) then
tmp = c + ((x * y) + t_1)
else
tmp = c + (b * (((z * (t * 0.0625d0)) / 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 t_1 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5000000000.0) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else if ((a * b) <= 1e+121) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + (b * (((z * (t * 0.0625)) / b) - (a * 0.25)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5000000000.0: tmp = (c + t_1) - ((a * b) * 0.25) elif (a * b) <= 1e+121: tmp = c + ((x * y) + t_1) else: tmp = c + (b * (((z * (t * 0.0625)) / b) - (a * 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(a * b) <= -5000000000.0) tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 1e+121) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(c + Float64(b * Float64(Float64(Float64(z * Float64(t * 0.0625)) / b) - Float64(a * 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 ((a * b) <= -5000000000.0) tmp = (c + t_1) - ((a * b) * 0.25); elseif ((a * b) <= 1e+121) tmp = c + ((x * y) + t_1); else tmp = c + (b * (((z * (t * 0.0625)) / b) - (a * 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[LessEqual[N[(a * b), $MachinePrecision], -5000000000.0], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+121], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(N[(N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5000000000:\\
\;\;\;\;\left(c + t\_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 10^{+121}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(\frac{z \cdot \left(t \cdot 0.0625\right)}{b} - a \cdot 0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e9Initial program 98.3%
Taylor expanded in x around 0 90.7%
if -5e9 < (*.f64 a b) < 1.00000000000000004e121Initial program 98.7%
Taylor expanded in a around 0 96.1%
if 1.00000000000000004e121 < (*.f64 a b) Initial program 97.1%
Taylor expanded in b around inf 97.2%
Taylor expanded in t around inf 99.0%
associate-*r/99.0%
associate-*r*99.0%
Simplified99.0%
Final simplification95.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* a b) -5000000000.0) (not (<= (* a b) 1e+121)))
(- (+ c t_1) (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -5000000000.0) || !((a * b) <= 1e+121)) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((a * b) <= (-5000000000.0d0)) .or. (.not. ((a * b) <= 1d+121))) then
tmp = (c + t_1) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -5000000000.0) || !((a * b) <= 1e+121)) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((a * b) <= -5000000000.0) or not ((a * b) <= 1e+121): tmp = (c + t_1) - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -5000000000.0) || !(Float64(a * b) <= 1e+121)) tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((a * b) <= -5000000000.0) || ~(((a * b) <= 1e+121))) tmp = (c + t_1) - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -5000000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+121]], $MachinePrecision]], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5000000000 \lor \neg \left(a \cdot b \leq 10^{+121}\right):\\
\;\;\;\;\left(c + t\_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e9 or 1.00000000000000004e121 < (*.f64 a b) Initial program 97.9%
Taylor expanded in x around 0 93.8%
if -5e9 < (*.f64 a b) < 1.00000000000000004e121Initial program 98.7%
Taylor expanded in a around 0 96.1%
Final simplification95.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= a -1.9e+55)
(+ c (* a (* b -0.25)))
(if (<= a -1.9e-122)
(+ c (* t (* z 0.0625)))
(if (<= a 7.5e-288)
(+ (* x y) (* 0.0625 (* z t)))
(if (<= a 6e+18) (+ 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 (a <= -1.9e+55) {
tmp = c + (a * (b * -0.25));
} else if (a <= -1.9e-122) {
tmp = c + (t * (z * 0.0625));
} else if (a <= 7.5e-288) {
tmp = (x * y) + (0.0625 * (z * t));
} else if (a <= 6e+18) {
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 (a <= (-1.9d+55)) then
tmp = c + (a * (b * (-0.25d0)))
else if (a <= (-1.9d-122)) then
tmp = c + (t * (z * 0.0625d0))
else if (a <= 7.5d-288) then
tmp = (x * y) + (0.0625d0 * (z * t))
else if (a <= 6d+18) 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 (a <= -1.9e+55) {
tmp = c + (a * (b * -0.25));
} else if (a <= -1.9e-122) {
tmp = c + (t * (z * 0.0625));
} else if (a <= 7.5e-288) {
tmp = (x * y) + (0.0625 * (z * t));
} else if (a <= 6e+18) {
tmp = c + (x * y);
} else {
tmp = b * (a * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if a <= -1.9e+55: tmp = c + (a * (b * -0.25)) elif a <= -1.9e-122: tmp = c + (t * (z * 0.0625)) elif a <= 7.5e-288: tmp = (x * y) + (0.0625 * (z * t)) elif a <= 6e+18: 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 (a <= -1.9e+55) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (a <= -1.9e-122) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (a <= 7.5e-288) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); elseif (a <= 6e+18) 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 (a <= -1.9e+55) tmp = c + (a * (b * -0.25)); elseif (a <= -1.9e-122) tmp = c + (t * (z * 0.0625)); elseif (a <= 7.5e-288) tmp = (x * y) + (0.0625 * (z * t)); elseif (a <= 6e+18) 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[a, -1.9e+55], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.9e-122], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e-288], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e+18], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+55}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-122}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-288}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+18}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if a < -1.9e55Initial program 98.3%
associate--l+98.3%
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.5%
*-commutative68.5%
associate-*r*68.5%
Simplified68.5%
if -1.9e55 < a < -1.9e-122Initial program 100.0%
Taylor expanded in t around inf 94.1%
Taylor expanded in z around inf 69.7%
if -1.9e-122 < a < 7.4999999999999998e-288Initial program 100.0%
Taylor expanded in a around 0 97.7%
Taylor expanded in c around 0 81.6%
if 7.4999999999999998e-288 < a < 6e18Initial program 100.0%
Taylor expanded in a around 0 93.0%
Taylor expanded in t around 0 56.4%
if 6e18 < a Initial program 94.3%
associate--l+94.3%
fma-define98.1%
associate-/l*98.1%
fma-neg98.1%
distribute-neg-frac298.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in a around inf 67.4%
*-commutative67.4%
associate-*r*67.4%
Simplified67.4%
Taylor expanded in b around inf 63.9%
Taylor expanded in a around inf 53.0%
Final simplification65.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+113)
(- t_2 t_1)
(if (<= (* a b) 4e+110) (+ c (+ (* x y) t_2)) (- (+ c (* x y)) t_1)))))
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 ((a * b) <= -5e+113) {
tmp = t_2 - t_1;
} else if ((a * b) <= 4e+110) {
tmp = c + ((x * y) + t_2);
} 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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+113)) then
tmp = t_2 - t_1
else if ((a * b) <= 4d+110) then
tmp = c + ((x * y) + t_2)
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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+113) {
tmp = t_2 - t_1;
} else if ((a * b) <= 4e+110) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + (x * y)) - t_1;
}
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 (a * b) <= -5e+113: tmp = t_2 - t_1 elif (a * b) <= 4e+110: tmp = c + ((x * y) + t_2) else: tmp = (c + (x * y)) - t_1 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(a * b) <= -5e+113) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 4e+110) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + Float64(x * y)) - t_1); 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 ((a * b) <= -5e+113) tmp = t_2 - t_1; elseif ((a * b) <= 4e+110) tmp = c + ((x * y) + t_2); else tmp = (c + (x * y)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+113], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e+110], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $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}\;a \cdot b \leq -5 \cdot 10^{+113}:\\
\;\;\;\;t\_2 - t\_1\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+110}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5e113Initial program 97.6%
Taylor expanded in x around 0 91.3%
Taylor expanded in c around 0 91.3%
if -5e113 < (*.f64 a b) < 4.0000000000000001e110Initial program 98.9%
Taylor expanded in a around 0 94.4%
if 4.0000000000000001e110 < (*.f64 a b) Initial program 97.4%
Taylor expanded in z around 0 89.1%
Final simplification93.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+113)
(- t_1 (* (* a b) 0.25))
(if (<= (* a b) 2e+156) (+ c (+ (* x y) t_1)) (+ c (* 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 ((a * b) <= -5e+113) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 2e+156) {
tmp = c + ((x * y) + t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+113)) then
tmp = t_1 - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+156) then
tmp = c + ((x * y) + t_1)
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 t_1 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+113) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 2e+156) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+113: tmp = t_1 - ((a * b) * 0.25) elif (a * b) <= 2e+156: tmp = c + ((x * y) + t_1) else: tmp = c + (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(a * b) <= -5e+113) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+156) tmp = Float64(c + Float64(Float64(x * y) + t_1)); 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) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+113) tmp = t_1 - ((a * b) * 0.25); elseif ((a * b) <= 2e+156) tmp = c + ((x * y) + t_1); else tmp = c + (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[LessEqual[N[(a * b), $MachinePrecision], -5e+113], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+156], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+113}:\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+156}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e113Initial program 97.6%
Taylor expanded in x around 0 91.3%
Taylor expanded in c around 0 91.3%
if -5e113 < (*.f64 a b) < 2e156Initial program 98.9%
Taylor expanded in a around 0 93.5%
if 2e156 < (*.f64 a b) Initial program 96.8%
associate--l+96.8%
fma-define99.9%
associate-/l*99.9%
fma-neg99.9%
distribute-neg-frac299.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 91.8%
*-commutative91.8%
associate-*r*91.8%
Simplified91.8%
Final simplification93.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= b -6.2e+19)
(+ c (* a (* b -0.25)))
(if (<= b 4.7e+226)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(* b (+ (* a -0.25) (/ c b))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -6.2e+19) {
tmp = c + (a * (b * -0.25));
} else if (b <= 4.7e+226) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = b * ((a * -0.25) + (c / b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-6.2d+19)) then
tmp = c + (a * (b * (-0.25d0)))
else if (b <= 4.7d+226) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = b * ((a * (-0.25d0)) + (c / b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -6.2e+19) {
tmp = c + (a * (b * -0.25));
} else if (b <= 4.7e+226) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = b * ((a * -0.25) + (c / b));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -6.2e+19: tmp = c + (a * (b * -0.25)) elif b <= 4.7e+226: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = b * ((a * -0.25) + (c / b)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -6.2e+19) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (b <= 4.7e+226) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(b * Float64(Float64(a * -0.25) + Float64(c / b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= -6.2e+19) tmp = c + (a * (b * -0.25)); elseif (b <= 4.7e+226) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = b * ((a * -0.25) + (c / b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -6.2e+19], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.7e+226], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(a * -0.25), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.2 \cdot 10^{+19}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{+226}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25 + \frac{c}{b}\right)\\
\end{array}
\end{array}
if b < -6.2e19Initial program 96.9%
associate--l+96.9%
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 66.7%
*-commutative66.7%
associate-*r*66.7%
Simplified66.7%
if -6.2e19 < b < 4.69999999999999991e226Initial program 98.9%
Taylor expanded in a around 0 85.1%
if 4.69999999999999991e226 < b Initial program 99.9%
associate--l+99.9%
fma-define99.9%
associate-/l*99.9%
fma-neg99.9%
distribute-neg-frac299.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 65.3%
*-commutative65.3%
associate-*r*65.3%
Simplified65.3%
Taylor expanded in b around inf 65.4%
Final simplification79.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= z -1.9e-26)
t_1
(if (<= z 7.2e-304) c (if (<= z 4e-124) (* 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 (z <= -1.9e-26) {
tmp = t_1;
} else if (z <= 7.2e-304) {
tmp = c;
} else if (z <= 4e-124) {
tmp = x * y;
} 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 (z <= (-1.9d-26)) then
tmp = t_1
else if (z <= 7.2d-304) then
tmp = c
else if (z <= 4d-124) then
tmp = x * y
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 (z <= -1.9e-26) {
tmp = t_1;
} else if (z <= 7.2e-304) {
tmp = c;
} else if (z <= 4e-124) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if z <= -1.9e-26: tmp = t_1 elif z <= 7.2e-304: tmp = c elif z <= 4e-124: tmp = x * y 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 (z <= -1.9e-26) tmp = t_1; elseif (z <= 7.2e-304) tmp = c; elseif (z <= 4e-124) tmp = Float64(x * y); 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 (z <= -1.9e-26) tmp = t_1; elseif (z <= 7.2e-304) tmp = c; elseif (z <= 4e-124) tmp = x * y; 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[z, -1.9e-26], t$95$1, If[LessEqual[z, 7.2e-304], c, If[LessEqual[z, 4e-124], N[(x * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-304}:\\
\;\;\;\;c\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-124}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.90000000000000007e-26 or 3.99999999999999973e-124 < z Initial program 98.1%
Taylor expanded in a around 0 77.6%
Taylor expanded in c around 0 63.4%
Taylor expanded in t around inf 50.7%
if -1.90000000000000007e-26 < z < 7.2000000000000003e-304Initial program 98.3%
Taylor expanded in c around inf 42.1%
if 7.2000000000000003e-304 < z < 3.99999999999999973e-124Initial program 100.0%
Taylor expanded in a around 0 65.4%
Taylor expanded in c around 0 51.3%
Taylor expanded in t around 0 48.0%
Final simplification48.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= b -3.8e+19)
(+ c (* a (* b -0.25)))
(if (<= b 64000000000000.0)
(+ c (* t (* z 0.0625)))
(* b (+ (* a -0.25) (/ c b))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.8e+19) {
tmp = c + (a * (b * -0.25));
} else if (b <= 64000000000000.0) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = b * ((a * -0.25) + (c / b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-3.8d+19)) then
tmp = c + (a * (b * (-0.25d0)))
else if (b <= 64000000000000.0d0) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = b * ((a * (-0.25d0)) + (c / b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.8e+19) {
tmp = c + (a * (b * -0.25));
} else if (b <= 64000000000000.0) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = b * ((a * -0.25) + (c / b));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if b <= -3.8e+19: tmp = c + (a * (b * -0.25)) elif b <= 64000000000000.0: tmp = c + (t * (z * 0.0625)) else: tmp = b * ((a * -0.25) + (c / b)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -3.8e+19) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (b <= 64000000000000.0) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = Float64(b * Float64(Float64(a * -0.25) + Float64(c / b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (b <= -3.8e+19) tmp = c + (a * (b * -0.25)); elseif (b <= 64000000000000.0) tmp = c + (t * (z * 0.0625)); else tmp = b * ((a * -0.25) + (c / b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3.8e+19], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 64000000000000.0], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(a * -0.25), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+19}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;b \leq 64000000000000:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25 + \frac{c}{b}\right)\\
\end{array}
\end{array}
if b < -3.8e19Initial program 96.9%
associate--l+96.9%
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 66.7%
*-commutative66.7%
associate-*r*66.7%
Simplified66.7%
if -3.8e19 < b < 6.4e13Initial program 98.6%
Taylor expanded in t around inf 91.0%
Taylor expanded in z around inf 72.2%
if 6.4e13 < b Initial program 99.9%
associate--l+99.9%
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 57.1%
*-commutative57.1%
associate-*r*57.1%
Simplified57.1%
Taylor expanded in b around inf 57.1%
Final simplification67.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -490000000000.0) (not (<= b 5e+14))) (+ c (* a (* b -0.25))) (+ c (* t (* z 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -490000000000.0) || !(b <= 5e+14)) {
tmp = c + (a * (b * -0.25));
} 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 ((b <= (-490000000000.0d0)) .or. (.not. (b <= 5d+14))) then
tmp = c + (a * (b * (-0.25d0)))
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 ((b <= -490000000000.0) || !(b <= 5e+14)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -490000000000.0) or not (b <= 5e+14): tmp = c + (a * (b * -0.25)) else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -490000000000.0) || !(b <= 5e+14)) tmp = Float64(c + Float64(a * Float64(b * -0.25))); 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 ((b <= -490000000000.0) || ~((b <= 5e+14))) tmp = c + (a * (b * -0.25)); else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -490000000000.0], N[Not[LessEqual[b, 5e+14]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -490000000000 \lor \neg \left(b \leq 5 \cdot 10^{+14}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if b < -4.9e11 or 5e14 < b Initial program 98.3%
associate--l+98.3%
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 62.0%
*-commutative62.0%
associate-*r*62.0%
Simplified62.0%
if -4.9e11 < b < 5e14Initial program 98.6%
Taylor expanded in t around inf 90.9%
Taylor expanded in z around inf 72.0%
Final simplification67.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -3.1e+146) (not (<= z 2.9e-15))) (* 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 ((z <= -3.1e+146) || !(z <= 2.9e-15)) {
tmp = 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 ((z <= (-3.1d+146)) .or. (.not. (z <= 2.9d-15))) then
tmp = 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 ((z <= -3.1e+146) || !(z <= 2.9e-15)) {
tmp = 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 (z <= -3.1e+146) or not (z <= 2.9e-15): tmp = 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 ((z <= -3.1e+146) || !(z <= 2.9e-15)) tmp = 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 ((z <= -3.1e+146) || ~((z <= 2.9e-15))) tmp = 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[Or[LessEqual[z, -3.1e+146], N[Not[LessEqual[z, 2.9e-15]], $MachinePrecision]], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+146} \lor \neg \left(z \leq 2.9 \cdot 10^{-15}\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if z < -3.1000000000000002e146 or 2.90000000000000019e-15 < z Initial program 97.2%
Taylor expanded in a around 0 76.3%
Taylor expanded in c around 0 65.3%
Taylor expanded in t around inf 58.0%
if -3.1000000000000002e146 < z < 2.90000000000000019e-15Initial program 99.3%
associate--l+99.3%
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 57.6%
*-commutative57.6%
associate-*r*57.6%
Simplified57.6%
Final simplification57.8%
(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.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.4e+64) (not (<= z 2.4e-59))) (* 0.0625 (* z t)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.4e+64) || !(z <= 2.4e-59)) {
tmp = 0.0625 * (z * t);
} 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) :: tmp
if ((z <= (-1.4d+64)) .or. (.not. (z <= 2.4d-59))) then
tmp = 0.0625d0 * (z * t)
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 tmp;
if ((z <= -1.4e+64) || !(z <= 2.4e-59)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.4e+64) or not (z <= 2.4e-59): tmp = 0.0625 * (z * t) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.4e+64) || !(z <= 2.4e-59)) tmp = Float64(0.0625 * Float64(z * t)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -1.4e+64) || ~((z <= 2.4e-59))) tmp = 0.0625 * (z * t); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.4e+64], N[Not[LessEqual[z, 2.4e-59]], $MachinePrecision]], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+64} \lor \neg \left(z \leq 2.4 \cdot 10^{-59}\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if z < -1.40000000000000012e64 or 2.40000000000000015e-59 < z Initial program 97.7%
Taylor expanded in a around 0 78.9%
Taylor expanded in c around 0 65.5%
Taylor expanded in t around inf 55.4%
if -1.40000000000000012e64 < z < 2.40000000000000015e-59Initial program 99.2%
Taylor expanded in a around 0 66.9%
Taylor expanded in t around 0 56.7%
Final simplification56.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -6.4e+16) (not (<= b 5200000000000.0))) (* b (* a -0.25)) (* 0.0625 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -6.4e+16) || !(b <= 5200000000000.0)) {
tmp = b * (a * -0.25);
} else {
tmp = 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 ((b <= (-6.4d+16)) .or. (.not. (b <= 5200000000000.0d0))) then
tmp = b * (a * (-0.25d0))
else
tmp = 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 ((b <= -6.4e+16) || !(b <= 5200000000000.0)) {
tmp = b * (a * -0.25);
} else {
tmp = 0.0625 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -6.4e+16) or not (b <= 5200000000000.0): tmp = b * (a * -0.25) else: tmp = 0.0625 * (z * t) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -6.4e+16) || !(b <= 5200000000000.0)) tmp = Float64(b * Float64(a * -0.25)); else tmp = 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 ((b <= -6.4e+16) || ~((b <= 5200000000000.0))) tmp = b * (a * -0.25); else tmp = 0.0625 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -6.4e+16], N[Not[LessEqual[b, 5200000000000.0]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+16} \lor \neg \left(b \leq 5200000000000\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if b < -6.4e16 or 5.2e12 < b Initial program 98.3%
associate--l+98.3%
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 62.0%
*-commutative62.0%
associate-*r*62.0%
Simplified62.0%
Taylor expanded in b around inf 62.0%
Taylor expanded in a around inf 50.6%
if -6.4e16 < b < 5.2e12Initial program 98.6%
Taylor expanded in a around 0 92.0%
Taylor expanded in c around 0 64.2%
Taylor expanded in t around inf 44.0%
Final simplification47.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= c -1.2e+107) c (if (<= c 78.0) (* x y) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -1.2e+107) {
tmp = c;
} else if (c <= 78.0) {
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 (c <= (-1.2d+107)) then
tmp = c
else if (c <= 78.0d0) 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 (c <= -1.2e+107) {
tmp = c;
} else if (c <= 78.0) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if c <= -1.2e+107: tmp = c elif c <= 78.0: tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -1.2e+107) tmp = c; elseif (c <= 78.0) 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 (c <= -1.2e+107) tmp = c; elseif (c <= 78.0) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -1.2e+107], c, If[LessEqual[c, 78.0], N[(x * y), $MachinePrecision], c]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.2 \cdot 10^{+107}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 78:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -1.2e107 or 78 < c Initial program 97.3%
Taylor expanded in c around inf 45.5%
if -1.2e107 < c < 78Initial program 99.3%
Taylor expanded in a around 0 68.6%
Taylor expanded in c around 0 65.6%
Taylor expanded in t around 0 29.5%
(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.4%
Taylor expanded in c around inf 22.7%
herbie shell --seed 2024132
(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))