
(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.4%
associate--l+98.4%
fma-define98.8%
associate-/l*98.8%
fma-neg98.8%
distribute-neg-frac298.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.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.4%
associate-+l-98.4%
*-commutative98.4%
associate-+l-98.4%
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 (* 0.0625 (* z t))))
(if (<= (* x y) -5e+121)
(+ c (* x y))
(if (<= (* x y) 200000.0)
(+ c t_1)
(if (<= (* x y) 1e+84)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 4e+104)
(+ (* x y) t_1)
(* y (- x (* 0.25 (/ (* a b) 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) <= -5e+121) {
tmp = c + (x * y);
} else if ((x * y) <= 200000.0) {
tmp = c + t_1;
} else if ((x * y) <= 1e+84) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+104) {
tmp = (x * y) + t_1;
} else {
tmp = y * (x - (0.25 * ((a * b) / 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) <= (-5d+121)) then
tmp = c + (x * y)
else if ((x * y) <= 200000.0d0) then
tmp = c + t_1
else if ((x * y) <= 1d+84) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 4d+104) then
tmp = (x * y) + t_1
else
tmp = y * (x - (0.25d0 * ((a * b) / 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) <= -5e+121) {
tmp = c + (x * y);
} else if ((x * y) <= 200000.0) {
tmp = c + t_1;
} else if ((x * y) <= 1e+84) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+104) {
tmp = (x * y) + t_1;
} else {
tmp = y * (x - (0.25 * ((a * b) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -5e+121: tmp = c + (x * y) elif (x * y) <= 200000.0: tmp = c + t_1 elif (x * y) <= 1e+84: tmp = c + (a * (b * -0.25)) elif (x * y) <= 4e+104: tmp = (x * y) + t_1 else: tmp = y * (x - (0.25 * ((a * b) / 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) <= -5e+121) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= 200000.0) tmp = Float64(c + t_1); elseif (Float64(x * y) <= 1e+84) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 4e+104) tmp = Float64(Float64(x * y) + t_1); else tmp = Float64(y * Float64(x - Float64(0.25 * Float64(Float64(a * b) / 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) <= -5e+121) tmp = c + (x * y); elseif ((x * y) <= 200000.0) tmp = c + t_1; elseif ((x * y) <= 1e+84) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 4e+104) tmp = (x * y) + t_1; else tmp = y * (x - (0.25 * ((a * b) / 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], -5e+121], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200000.0], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+84], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+104], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(y * N[(x - N[(0.25 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+121}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 200000:\\
\;\;\;\;c + t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+84}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+104}:\\
\;\;\;\;x \cdot y + t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x - 0.25 \cdot \frac{a \cdot b}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000007e121Initial program 100.0%
Taylor expanded in x around inf 87.5%
if -5.00000000000000007e121 < (*.f64 x y) < 2e5Initial program 100.0%
Taylor expanded in z around inf 66.4%
if 2e5 < (*.f64 x y) < 1.00000000000000006e84Initial program 99.9%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
associate-*r*76.9%
Simplified76.9%
if 1.00000000000000006e84 < (*.f64 x y) < 4e104Initial program 66.7%
Taylor expanded in a around 0 100.0%
Taylor expanded in c around 0 84.5%
if 4e104 < (*.f64 x y) Initial program 95.7%
Taylor expanded in y around inf 96.0%
Taylor expanded in t around 0 91.9%
Taylor expanded in c around 0 85.8%
Final simplification74.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -5e+121)
(+ c (* x y))
(if (<= (* x y) 200000.0)
(+ c t_1)
(if (<= (* x y) 1e+84)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 4e+104)
(+ (* x y) t_1)
(+ (* x y) (* (* a b) -0.25))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -5e+121) {
tmp = c + (x * y);
} else if ((x * y) <= 200000.0) {
tmp = c + t_1;
} else if ((x * y) <= 1e+84) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+104) {
tmp = (x * y) + t_1;
} else {
tmp = (x * y) + ((a * b) * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((x * y) <= (-5d+121)) then
tmp = c + (x * y)
else if ((x * y) <= 200000.0d0) then
tmp = c + t_1
else if ((x * y) <= 1d+84) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 4d+104) then
tmp = (x * y) + t_1
else
tmp = (x * y) + ((a * b) * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -5e+121) {
tmp = c + (x * y);
} else if ((x * y) <= 200000.0) {
tmp = c + t_1;
} else if ((x * y) <= 1e+84) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+104) {
tmp = (x * y) + t_1;
} else {
tmp = (x * y) + ((a * b) * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -5e+121: tmp = c + (x * y) elif (x * y) <= 200000.0: tmp = c + t_1 elif (x * y) <= 1e+84: tmp = c + (a * (b * -0.25)) elif (x * y) <= 4e+104: tmp = (x * y) + t_1 else: tmp = (x * y) + ((a * b) * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -5e+121) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= 200000.0) tmp = Float64(c + t_1); elseif (Float64(x * y) <= 1e+84) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 4e+104) tmp = Float64(Float64(x * y) + t_1); else tmp = Float64(Float64(x * y) + Float64(Float64(a * b) * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -5e+121) tmp = c + (x * y); elseif ((x * y) <= 200000.0) tmp = c + t_1; elseif ((x * y) <= 1e+84) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 4e+104) tmp = (x * y) + t_1; else tmp = (x * y) + ((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[(x * y), $MachinePrecision], -5e+121], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200000.0], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+84], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+104], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+121}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 200000:\\
\;\;\;\;c + t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+84}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+104}:\\
\;\;\;\;x \cdot y + t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + \left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000007e121Initial program 100.0%
Taylor expanded in x around inf 87.5%
if -5.00000000000000007e121 < (*.f64 x y) < 2e5Initial program 100.0%
Taylor expanded in z around inf 66.4%
if 2e5 < (*.f64 x y) < 1.00000000000000006e84Initial program 99.9%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
associate-*r*76.9%
Simplified76.9%
if 1.00000000000000006e84 < (*.f64 x y) < 4e104Initial program 66.7%
Taylor expanded in a around 0 100.0%
Taylor expanded in c around 0 84.5%
if 4e104 < (*.f64 x y) Initial program 95.7%
Taylor expanded in y around inf 96.0%
Taylor expanded in t around 0 91.9%
Taylor expanded in c around 0 85.8%
Taylor expanded in y around 0 85.5%
Final simplification74.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (* (* a b) -0.25))))
(if (<= (* a b) -5e+95)
t_1
(if (<= (* a b) -4e-95)
(+ c (* 0.0625 (* z t)))
(if (<= (* a b) 2e+51) (+ c (* x y)) 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 ((a * b) <= -5e+95) {
tmp = t_1;
} else if ((a * b) <= -4e-95) {
tmp = c + (0.0625 * (z * t));
} else if ((a * b) <= 2e+51) {
tmp = c + (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 = (x * y) + ((a * b) * (-0.25d0))
if ((a * b) <= (-5d+95)) then
tmp = t_1
else if ((a * b) <= (-4d-95)) then
tmp = c + (0.0625d0 * (z * t))
else if ((a * b) <= 2d+51) then
tmp = c + (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 = (x * y) + ((a * b) * -0.25);
double tmp;
if ((a * b) <= -5e+95) {
tmp = t_1;
} else if ((a * b) <= -4e-95) {
tmp = c + (0.0625 * (z * t));
} else if ((a * b) <= 2e+51) {
tmp = c + (x * y);
} 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 (a * b) <= -5e+95: tmp = t_1 elif (a * b) <= -4e-95: tmp = c + (0.0625 * (z * t)) elif (a * b) <= 2e+51: tmp = c + (x * y) 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(a * b) <= -5e+95) tmp = t_1; elseif (Float64(a * b) <= -4e-95) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(a * b) <= 2e+51) tmp = Float64(c + Float64(x * y)); 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 ((a * b) <= -5e+95) tmp = t_1; elseif ((a * b) <= -4e-95) tmp = c + (0.0625 * (z * t)); elseif ((a * b) <= 2e+51) tmp = c + (x * y); 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[(a * b), $MachinePrecision], -5e+95], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -4e-95], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+51], N[(c + N[(x * y), $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}\;a \cdot b \leq -5 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-95}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+51}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000025e95 or 2e51 < (*.f64 a b) Initial program 96.8%
Taylor expanded in y around inf 76.7%
Taylor expanded in t around 0 71.0%
Taylor expanded in c around 0 68.9%
Taylor expanded in y around 0 80.8%
if -5.00000000000000025e95 < (*.f64 a b) < -3.99999999999999996e-95Initial program 99.9%
Taylor expanded in z around inf 73.5%
if -3.99999999999999996e-95 < (*.f64 a b) < 2e51Initial program 99.2%
Taylor expanded in x around inf 69.7%
Final simplification74.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -5e+121)
t_1
(if (<= (* x y) 200000.0)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 1e+84) (+ 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) <= -5e+121) {
tmp = t_1;
} else if ((x * y) <= 200000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 1e+84) {
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) <= (-5d+121)) then
tmp = t_1
else if ((x * y) <= 200000.0d0) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 1d+84) 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) <= -5e+121) {
tmp = t_1;
} else if ((x * y) <= 200000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 1e+84) {
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) <= -5e+121: tmp = t_1 elif (x * y) <= 200000.0: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 1e+84: 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) <= -5e+121) tmp = t_1; elseif (Float64(x * y) <= 200000.0) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 1e+84) 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) <= -5e+121) tmp = t_1; elseif ((x * y) <= 200000.0) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 1e+84) 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], -5e+121], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 200000.0], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+84], 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 -5 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 200000:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+84}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000007e121 or 1.00000000000000006e84 < (*.f64 x y) Initial program 96.0%
Taylor expanded in x around inf 82.3%
if -5.00000000000000007e121 < (*.f64 x y) < 2e5Initial program 100.0%
Taylor expanded in z around inf 66.4%
if 2e5 < (*.f64 x y) < 1.00000000000000006e84Initial program 99.9%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
associate-*r*76.9%
Simplified76.9%
Final simplification73.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -2e+47)
(+ c (+ (* x y) t_1))
(if (<= (* x y) 2e+93)
(+ c (- t_1 (* (* a b) 0.25)))
(+ c (* y (- x (* 0.25 (/ (* a b) 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+47) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 2e+93) {
tmp = c + (t_1 - ((a * b) * 0.25));
} else {
tmp = c + (y * (x - (0.25 * ((a * b) / 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+47)) then
tmp = c + ((x * y) + t_1)
else if ((x * y) <= 2d+93) then
tmp = c + (t_1 - ((a * b) * 0.25d0))
else
tmp = c + (y * (x - (0.25d0 * ((a * b) / 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+47) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 2e+93) {
tmp = c + (t_1 - ((a * b) * 0.25));
} else {
tmp = c + (y * (x - (0.25 * ((a * b) / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -2e+47: tmp = c + ((x * y) + t_1) elif (x * y) <= 2e+93: tmp = c + (t_1 - ((a * b) * 0.25)) else: tmp = c + (y * (x - (0.25 * ((a * b) / 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+47) tmp = Float64(c + Float64(Float64(x * y) + t_1)); elseif (Float64(x * y) <= 2e+93) tmp = Float64(c + Float64(t_1 - Float64(Float64(a * b) * 0.25))); else tmp = Float64(c + Float64(y * Float64(x - Float64(0.25 * Float64(Float64(a * b) / 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+47) tmp = c + ((x * y) + t_1); elseif ((x * y) <= 2e+93) tmp = c + (t_1 - ((a * b) * 0.25)); else tmp = c + (y * (x - (0.25 * ((a * b) / 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+47], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+93], N[(c + N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(y * N[(x - N[(0.25 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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^{+47}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+93}:\\
\;\;\;\;c + \left(t\_1 - \left(a \cdot b\right) \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x - 0.25 \cdot \frac{a \cdot b}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e47Initial program 100.0%
Taylor expanded in a around 0 92.4%
if -2.0000000000000001e47 < (*.f64 x y) < 2.00000000000000009e93Initial program 100.0%
Taylor expanded in x around 0 96.2%
if 2.00000000000000009e93 < (*.f64 x y) Initial program 92.0%
Taylor expanded in y around inf 92.2%
Taylor expanded in t around 0 88.4%
Final simplification93.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+79) (not (<= (* a b) 1.0))) (+ 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) <= -5e+79) || !((a * b) <= 1.0)) {
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) <= (-5d+79)) .or. (.not. ((a * b) <= 1.0d0))) 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) <= -5e+79) || !((a * b) <= 1.0)) {
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) <= -5e+79) or not ((a * b) <= 1.0): 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) <= -5e+79) || !(Float64(a * b) <= 1.0)) tmp = Float64(c + Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+79) || ~(((a * b) <= 1.0))) 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], -5e+79], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.0]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 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 \cdot b \leq -5 \cdot 10^{+79} \lor \neg \left(a \cdot b \leq 1\right):\\
\;\;\;\;c + \left(x \cdot y - \left(a \cdot b\right) \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) < -5e79 or 1 < (*.f64 a b) Initial program 97.3%
Taylor expanded in z around 0 84.5%
if -5e79 < (*.f64 a b) < 1Initial program 99.3%
Taylor expanded in a around 0 97.4%
Final simplification91.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+132)
(+ (* x y) (* (* a b) -0.25))
(if (<= (* a b) 1e+262)
(+ 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) <= -2e+132) {
tmp = (x * y) + ((a * b) * -0.25);
} else if ((a * b) <= 1e+262) {
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) <= (-2d+132)) then
tmp = (x * y) + ((a * b) * (-0.25d0))
else if ((a * b) <= 1d+262) 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) <= -2e+132) {
tmp = (x * y) + ((a * b) * -0.25);
} else if ((a * b) <= 1e+262) {
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) <= -2e+132: tmp = (x * y) + ((a * b) * -0.25) elif (a * b) <= 1e+262: 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) <= -2e+132) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) * -0.25)); elseif (Float64(a * b) <= 1e+262) 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) <= -2e+132) tmp = (x * y) + ((a * b) * -0.25); elseif ((a * b) <= 1e+262) 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], -2e+132], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+262], 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 -2 \cdot 10^{+132}:\\
\;\;\;\;x \cdot y + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;a \cdot b \leq 10^{+262}:\\
\;\;\;\;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.99999999999999998e132Initial program 97.3%
Taylor expanded in y around inf 71.2%
Taylor expanded in t around 0 72.1%
Taylor expanded in c around 0 72.1%
Taylor expanded in y around 0 90.5%
if -1.99999999999999998e132 < (*.f64 a b) < 1e262Initial program 99.5%
Taylor expanded in a around 0 90.1%
if 1e262 < (*.f64 a b) Initial program 88.9%
Taylor expanded in a around inf 94.4%
*-commutative94.4%
associate-*r*94.4%
Simplified94.4%
Final simplification90.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -5e+121) (not (<= (* x y) 1e+98))) (+ 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) <= -5e+121) || !((x * y) <= 1e+98)) {
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) <= (-5d+121)) .or. (.not. ((x * y) <= 1d+98))) 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) <= -5e+121) || !((x * y) <= 1e+98)) {
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) <= -5e+121) or not ((x * y) <= 1e+98): 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) <= -5e+121) || !(Float64(x * y) <= 1e+98)) 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) <= -5e+121) || ~(((x * y) <= 1e+98))) 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], -5e+121], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+98]], $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 -5 \cdot 10^{+121} \lor \neg \left(x \cdot y \leq 10^{+98}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000007e121 or 9.99999999999999998e97 < (*.f64 x y) Initial program 96.8%
Taylor expanded in x around inf 83.7%
if -5.00000000000000007e121 < (*.f64 x y) < 9.99999999999999998e97Initial program 99.4%
Taylor expanded in z around inf 64.2%
Final simplification71.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -19.0) (* x y) (if (<= y 2.2e-247) c (if (<= y 6.2e+91) (* z (* t 0.0625)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -19.0) {
tmp = x * y;
} else if (y <= 2.2e-247) {
tmp = c;
} else if (y <= 6.2e+91) {
tmp = z * (t * 0.0625);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (y <= (-19.0d0)) then
tmp = x * y
else if (y <= 2.2d-247) then
tmp = c
else if (y <= 6.2d+91) then
tmp = z * (t * 0.0625d0)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -19.0) {
tmp = x * y;
} else if (y <= 2.2e-247) {
tmp = c;
} else if (y <= 6.2e+91) {
tmp = z * (t * 0.0625);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -19.0: tmp = x * y elif y <= 2.2e-247: tmp = c elif y <= 6.2e+91: tmp = z * (t * 0.0625) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -19.0) tmp = Float64(x * y); elseif (y <= 2.2e-247) tmp = c; elseif (y <= 6.2e+91) tmp = Float64(z * Float64(t * 0.0625)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -19.0) tmp = x * y; elseif (y <= 2.2e-247) tmp = c; elseif (y <= 6.2e+91) tmp = z * (t * 0.0625); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -19.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 2.2e-247], c, If[LessEqual[y, 6.2e+91], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -19:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-247}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+91}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -19 or 6.19999999999999995e91 < y Initial program 97.5%
Taylor expanded in y around inf 98.3%
Taylor expanded in t around 0 87.1%
Taylor expanded in c around 0 69.5%
Taylor expanded in x around inf 54.4%
if -19 < y < 2.19999999999999992e-247Initial program 98.5%
Taylor expanded in x around inf 32.5%
Taylor expanded in x around 0 25.4%
if 2.19999999999999992e-247 < y < 6.19999999999999995e91Initial program 100.0%
Taylor expanded in z around inf 93.2%
Taylor expanded in a around 0 69.6%
Taylor expanded in z around inf 40.9%
associate-*r*40.9%
*-commutative40.9%
Simplified40.9%
Final simplification43.2%
(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 -2.15e+179) (not (<= z 5.2e-18))) (* z (* t 0.0625)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.15e+179) || !(z <= 5.2e-18)) {
tmp = z * (t * 0.0625);
} 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 <= (-2.15d+179)) .or. (.not. (z <= 5.2d-18))) then
tmp = z * (t * 0.0625d0)
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 <= -2.15e+179) || !(z <= 5.2e-18)) {
tmp = z * (t * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2.15e+179) or not (z <= 5.2e-18): tmp = z * (t * 0.0625) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.15e+179) || !(z <= 5.2e-18)) tmp = Float64(z * Float64(t * 0.0625)); 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 <= -2.15e+179) || ~((z <= 5.2e-18))) tmp = z * (t * 0.0625); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2.15e+179], N[Not[LessEqual[z, 5.2e-18]], $MachinePrecision]], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+179} \lor \neg \left(z \leq 5.2 \cdot 10^{-18}\right):\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if z < -2.15e179 or 5.2000000000000001e-18 < z Initial program 96.4%
Taylor expanded in z around inf 97.6%
Taylor expanded in a around 0 88.3%
Taylor expanded in z around inf 55.4%
associate-*r*55.4%
*-commutative55.4%
Simplified55.4%
if -2.15e179 < z < 5.2000000000000001e-18Initial program 99.4%
Taylor expanded in x around inf 58.1%
Final simplification57.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= x -1e+33) (not (<= x 4.4e-126))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x <= -1e+33) || !(x <= 4.4e-126)) {
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 <= (-1d+33)) .or. (.not. (x <= 4.4d-126))) 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 <= -1e+33) || !(x <= 4.4e-126)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x <= -1e+33) or not (x <= 4.4e-126): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((x <= -1e+33) || !(x <= 4.4e-126)) 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 <= -1e+33) || ~((x <= 4.4e-126))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[x, -1e+33], N[Not[LessEqual[x, 4.4e-126]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+33} \lor \neg \left(x \leq 4.4 \cdot 10^{-126}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if x < -9.9999999999999995e32 or 4.40000000000000029e-126 < x Initial program 98.0%
Taylor expanded in y around inf 82.1%
Taylor expanded in t around 0 72.0%
Taylor expanded in c around 0 60.6%
Taylor expanded in x around inf 46.9%
if -9.9999999999999995e32 < x < 4.40000000000000029e-126Initial program 99.0%
Taylor expanded in x around inf 41.7%
Taylor expanded in x around 0 35.8%
Final simplification42.3%
(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 x around inf 51.6%
Taylor expanded in x around 0 22.6%
Final simplification22.6%
herbie shell --seed 2024067
(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))