
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY) (+ c (- (+ (* x y) (* z (* t 0.0625))) (* a (/ b 4.0)))) (- (+ c (* x y)) (* (* a b) 0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = c + (((x * y) + (z * (t * 0.0625))) - (a * (b / 4.0)));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= Double.POSITIVE_INFINITY) {
tmp = c + (((x * y) + (z * (t * 0.0625))) - (a * (b / 4.0)));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= math.inf: tmp = c + (((x * y) + (z * (t * 0.0625))) - (a * (b / 4.0))) else: tmp = (c + (x * y)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(c + Float64(Float64(Float64(x * y) + Float64(z * Float64(t * 0.0625))) - Float64(a * Float64(b / 4.0)))); else tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= Inf) tmp = c + (((x * y) + (z * (t * 0.0625))) - (a * (b / 4.0))); else tmp = (c + (x * y)) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;c + \left(\left(x \cdot y + z \cdot \left(t \cdot 0.0625\right)\right) - a \cdot \frac{b}{4}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.7%
associate-+l-99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
associate-+l-99.7%
fma-define99.7%
*-commutative99.7%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
fma-undefine100.0%
associate-*r/99.7%
+-commutative99.7%
associate-*r/100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around 0 80.0%
Final simplification99.6%
(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 97.7%
associate--l+97.7%
fma-define97.7%
associate-/l*98.0%
fmm-def99.2%
distribute-neg-frac299.2%
metadata-eval99.2%
Simplified99.2%
(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 97.7%
associate-+l-97.7%
+-commutative97.7%
*-commutative97.7%
+-commutative97.7%
associate-+l-97.7%
fma-define97.7%
*-commutative97.7%
associate-/l*98.0%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1e+192)
t_2
(if (<= (* x y) -2e-145)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 2e-182)
t_1
(if (<= (* x y) 1e+61)
(+ c (* z (* t 0.0625)))
(if (<= (* x y) 4e+201) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1e+192) {
tmp = t_2;
} else if ((x * y) <= -2e-145) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 2e-182) {
tmp = t_1;
} else if ((x * y) <= 1e+61) {
tmp = c + (z * (t * 0.0625));
} else if ((x * y) <= 4e+201) {
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 + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-1d+192)) then
tmp = t_2
else if ((x * y) <= (-2d-145)) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 2d-182) then
tmp = t_1
else if ((x * y) <= 1d+61) then
tmp = c + (z * (t * 0.0625d0))
else if ((x * y) <= 4d+201) 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 + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1e+192) {
tmp = t_2;
} else if ((x * y) <= -2e-145) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 2e-182) {
tmp = t_1;
} else if ((x * y) <= 1e+61) {
tmp = c + (z * (t * 0.0625));
} else if ((x * y) <= 4e+201) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1e+192: tmp = t_2 elif (x * y) <= -2e-145: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 2e-182: tmp = t_1 elif (x * y) <= 1e+61: tmp = c + (z * (t * 0.0625)) elif (x * y) <= 4e+201: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+192) tmp = t_2; elseif (Float64(x * y) <= -2e-145) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 2e-182) tmp = t_1; elseif (Float64(x * y) <= 1e+61) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); elseif (Float64(x * y) <= 4e+201) 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 + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+192) tmp = t_2; elseif ((x * y) <= -2e-145) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 2e-182) tmp = t_1; elseif ((x * y) <= 1e+61) tmp = c + (z * (t * 0.0625)); elseif ((x * y) <= 4e+201) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+192], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2e-145], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-182], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+61], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+201], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+192}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-145}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+61}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+201}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e192 or 4.00000000000000015e201 < (*.f64 x y) Initial program 93.9%
Taylor expanded in a around 0 91.1%
Taylor expanded in t around 0 91.2%
if -1.00000000000000004e192 < (*.f64 x y) < -1.99999999999999983e-145Initial program 100.0%
Taylor expanded in x around 0 96.6%
Taylor expanded in a around 0 69.1%
if -1.99999999999999983e-145 < (*.f64 x y) < 2.0000000000000001e-182 or 9.99999999999999949e60 < (*.f64 x y) < 4.00000000000000015e201Initial program 100.0%
associate--l+100.0%
fma-define100.0%
associate-/l*100.0%
fmm-def100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
if 2.0000000000000001e-182 < (*.f64 x y) < 9.99999999999999949e60Initial program 94.6%
Taylor expanded in x around 0 87.8%
associate--l+87.8%
associate-*r*90.3%
*-commutative90.3%
*-commutative90.3%
associate-*r*90.3%
Applied egg-rr90.3%
Taylor expanded in z around inf 74.2%
associate-*r*76.7%
*-commutative76.7%
Simplified76.7%
Final simplification77.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -1e+191)
t_1
(if (<= (* x y) -2e-145)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 2e-182)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 1e+61) (+ c (* z (* t 0.0625))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -1e+191) {
tmp = t_1;
} else if ((x * y) <= -2e-145) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 2e-182) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+61) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((a * b) * 0.25d0)
if ((x * y) <= (-1d+191)) then
tmp = t_1
else if ((x * y) <= (-2d-145)) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 2d-182) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 1d+61) then
tmp = c + (z * (t * 0.0625d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -1e+191) {
tmp = t_1;
} else if ((x * y) <= -2e-145) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 2e-182) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1e+61) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -1e+191: tmp = t_1 elif (x * y) <= -2e-145: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 2e-182: tmp = c + (a * (b * -0.25)) elif (x * y) <= 1e+61: tmp = c + (z * (t * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -1e+191) tmp = t_1; elseif (Float64(x * y) <= -2e-145) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 2e-182) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 1e+61) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -1e+191) tmp = t_1; elseif ((x * y) <= -2e-145) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 2e-182) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 1e+61) tmp = c + (z * (t * 0.0625)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+191], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-145], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-182], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+61], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-145}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-182}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+61}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000007e191 or 9.99999999999999949e60 < (*.f64 x y) Initial program 95.4%
Taylor expanded in z around 0 94.5%
Taylor expanded in c around 0 88.4%
if -1.00000000000000007e191 < (*.f64 x y) < -1.99999999999999983e-145Initial program 100.0%
Taylor expanded in x around 0 96.5%
Taylor expanded in a around 0 70.4%
if -1.99999999999999983e-145 < (*.f64 x y) < 2.0000000000000001e-182Initial program 100.0%
associate--l+100.0%
fma-define100.0%
associate-/l*100.0%
fmm-def100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 74.2%
*-commutative74.2%
associate-*r*74.2%
Simplified74.2%
if 2.0000000000000001e-182 < (*.f64 x y) < 9.99999999999999949e60Initial program 94.6%
Taylor expanded in x around 0 87.8%
associate--l+87.8%
associate-*r*90.3%
*-commutative90.3%
*-commutative90.3%
associate-*r*90.3%
Applied egg-rr90.3%
Taylor expanded in z around inf 74.2%
associate-*r*76.7%
*-commutative76.7%
Simplified76.7%
Final simplification78.5%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (- (+ c (* 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 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = (c + (x * y)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(Float64(c + 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 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = (c + (x * y)) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around 0 80.0%
Final simplification99.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+192) (not (<= (* x y) 1e+61))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (- (* 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 tmp;
if (((x * y) <= -1e+192) || !((x * y) <= 1e+61)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((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) :: tmp
if (((x * y) <= (-1d+192)) .or. (.not. ((x * y) <= 1d+61))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((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 tmp;
if (((x * y) <= -1e+192) || !((x * y) <= 1e+61)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1e+192) or not ((x * y) <= 1e+61): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1e+192) || !(Float64(x * y) <= 1e+61)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(z * Float64(t * 0.0625)) - Float64(b * Float64(a * 0.25)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1e+192) || ~(((x * y) <= 1e+61))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+192], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+61]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision] - N[(b * N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+192} \lor \neg \left(x \cdot y \leq 10^{+61}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(z \cdot \left(t \cdot 0.0625\right) - b \cdot \left(a \cdot 0.25\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e192 or 9.99999999999999949e60 < (*.f64 x y) Initial program 95.3%
Taylor expanded in z around 0 94.5%
if -1.00000000000000004e192 < (*.f64 x y) < 9.99999999999999949e60Initial program 98.9%
Taylor expanded in x around 0 96.4%
associate--l+96.4%
associate-*r*96.9%
*-commutative96.9%
*-commutative96.9%
associate-*r*96.9%
Applied egg-rr96.9%
Final simplification96.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+147) (not (<= (* a b) 2e+28))) (- (+ 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+147) || !((a * b) <= 2e+28)) {
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+147)) .or. (.not. ((a * b) <= 2d+28))) 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+147) || !((a * b) <= 2e+28)) {
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+147) or not ((a * b) <= 2e+28): 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+147) || !(Float64(a * b) <= 2e+28)) 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) <= -5e+147) || ~(((a * b) <= 2e+28))) 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+147], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+28]], $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 -5 \cdot 10^{+147} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+28}\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) < -5.0000000000000002e147 or 1.99999999999999992e28 < (*.f64 a b) Initial program 94.8%
Taylor expanded in z around 0 85.5%
if -5.0000000000000002e147 < (*.f64 a b) < 1.99999999999999992e28Initial program 99.4%
Taylor expanded in a around 0 93.6%
Final simplification90.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+147)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 5e+75)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+147) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+75) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} 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) :: tmp
if ((a * b) <= (-5d+147)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 5d+75) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
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 tmp;
if ((a * b) <= -5e+147) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+75) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+147: tmp = c + (a * (b * -0.25)) elif (a * b) <= 5e+75: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+147) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 5e+75) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); 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) tmp = 0.0; if ((a * b) <= -5e+147) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 5e+75) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+147], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+75], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+147}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+75}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000002e147Initial program 95.1%
associate--l+95.1%
fma-define95.1%
associate-/l*95.1%
fmm-def100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 80.9%
*-commutative80.9%
associate-*r*80.9%
Simplified80.9%
if -5.0000000000000002e147 < (*.f64 a b) < 5.0000000000000002e75Initial program 99.4%
Taylor expanded in a around 0 93.2%
if 5.0000000000000002e75 < (*.f64 a b) Initial program 93.2%
Taylor expanded in z around 0 86.4%
Taylor expanded in c around 0 77.2%
Final simplification88.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+192) (not (<= (* x y) 1e+61))) (+ c (* x y)) (+ c (* z (* t 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1e+192) || !((x * y) <= 1e+61)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-1d+192)) .or. (.not. ((x * y) <= 1d+61))) then
tmp = c + (x * y)
else
tmp = c + (z * (t * 0.0625d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1e+192) || !((x * y) <= 1e+61)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1e+192) or not ((x * y) <= 1e+61): tmp = c + (x * y) else: tmp = c + (z * (t * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1e+192) || !(Float64(x * y) <= 1e+61)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1e+192) || ~(((x * y) <= 1e+61))) tmp = c + (x * y); else tmp = c + (z * (t * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+192], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+61]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+192} \lor \neg \left(x \cdot y \leq 10^{+61}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e192 or 9.99999999999999949e60 < (*.f64 x y) Initial program 95.3%
Taylor expanded in a around 0 82.1%
Taylor expanded in t around 0 80.2%
if -1.00000000000000004e192 < (*.f64 x y) < 9.99999999999999949e60Initial program 98.9%
Taylor expanded in x around 0 96.4%
associate--l+96.4%
associate-*r*96.9%
*-commutative96.9%
*-commutative96.9%
associate-*r*96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 66.5%
associate-*r*67.0%
*-commutative67.0%
Simplified67.0%
Final simplification71.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+192) (not (<= (* x y) 1e+61))) (+ 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) <= -1e+192) || !((x * y) <= 1e+61)) {
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) <= (-1d+192)) .or. (.not. ((x * y) <= 1d+61))) 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) <= -1e+192) || !((x * y) <= 1e+61)) {
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) <= -1e+192) or not ((x * y) <= 1e+61): 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) <= -1e+192) || !(Float64(x * y) <= 1e+61)) 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) <= -1e+192) || ~(((x * y) <= 1e+61))) 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], -1e+192], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+61]], $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 -1 \cdot 10^{+192} \lor \neg \left(x \cdot y \leq 10^{+61}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e192 or 9.99999999999999949e60 < (*.f64 x y) Initial program 95.3%
Taylor expanded in a around 0 82.1%
Taylor expanded in t around 0 80.2%
if -1.00000000000000004e192 < (*.f64 x y) < 9.99999999999999949e60Initial program 98.9%
Taylor expanded in x around 0 96.4%
Taylor expanded in a around 0 66.5%
Final simplification71.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.25e+194) (not (<= a 3e-32))) (* a (* b -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.25e+194) || !(a <= 3e-32)) {
tmp = a * (b * -0.25);
} 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 ((a <= (-1.25d+194)) .or. (.not. (a <= 3d-32))) then
tmp = a * (b * (-0.25d0))
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 ((a <= -1.25e+194) || !(a <= 3e-32)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.25e+194) or not (a <= 3e-32): tmp = a * (b * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.25e+194) || !(a <= 3e-32)) tmp = Float64(a * Float64(b * -0.25)); 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 ((a <= -1.25e+194) || ~((a <= 3e-32))) tmp = a * (b * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -1.25e+194], N[Not[LessEqual[a, 3e-32]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+194} \lor \neg \left(a \leq 3 \cdot 10^{-32}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.24999999999999997e194 or 3e-32 < a Initial program 94.2%
Taylor expanded in z around inf 73.6%
Taylor expanded in a around inf 47.1%
associate-*r/44.8%
associate-*r*44.8%
*-commutative44.8%
Simplified44.8%
Taylor expanded in z around 0 53.9%
*-commutative53.9%
associate-*l*53.9%
*-commutative53.9%
Simplified53.9%
if -1.24999999999999997e194 < a < 3e-32Initial program 99.4%
Taylor expanded in a around 0 87.2%
Taylor expanded in t around 0 59.7%
Final simplification57.8%
(FPCore (x y z t a b c) :precision binary64 (if (<= c -2.25e+73) c (if (<= c 5.5e+24) (* a (* b -0.25)) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -2.25e+73) {
tmp = c;
} else if (c <= 5.5e+24) {
tmp = a * (b * -0.25);
} 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 <= (-2.25d+73)) then
tmp = c
else if (c <= 5.5d+24) then
tmp = a * (b * (-0.25d0))
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 <= -2.25e+73) {
tmp = c;
} else if (c <= 5.5e+24) {
tmp = a * (b * -0.25);
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if c <= -2.25e+73: tmp = c elif c <= 5.5e+24: tmp = a * (b * -0.25) else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -2.25e+73) tmp = c; elseif (c <= 5.5e+24) tmp = Float64(a * Float64(b * -0.25)); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (c <= -2.25e+73) tmp = c; elseif (c <= 5.5e+24) tmp = a * (b * -0.25); else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -2.25e+73], c, If[LessEqual[c, 5.5e+24], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], c]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.25 \cdot 10^{+73}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 5.5 \cdot 10^{+24}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -2.24999999999999992e73 or 5.5000000000000002e24 < c Initial program 97.3%
Taylor expanded in c around inf 50.7%
if -2.24999999999999992e73 < c < 5.5000000000000002e24Initial program 98.0%
Taylor expanded in z around inf 80.4%
Taylor expanded in a around inf 29.3%
associate-*r/27.3%
associate-*r*27.3%
*-commutative27.3%
Simplified27.3%
Taylor expanded in z around 0 37.8%
*-commutative37.8%
associate-*l*37.8%
*-commutative37.8%
Simplified37.8%
Final simplification43.2%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.7%
Taylor expanded in c around inf 25.2%
herbie shell --seed 2024163
(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))