
(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 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 98.0%
associate--l+98.0%
fma-define98.8%
associate-/l*99.2%
fmm-def99.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.0%
associate-+l-98.0%
+-commutative98.0%
*-commutative98.0%
+-commutative98.0%
associate-+l-98.0%
fma-define98.4%
*-commutative98.4%
associate-/l*98.8%
associate-/l*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625)))) (t_2 (+ c (* a (* b -0.25)))))
(if (<= (* a b) -2e+57)
t_2
(if (<= (* a b) -2e-80)
t_1
(if (<= (* a b) 2e-82)
(+ c (* x y))
(if (<= (* a b) 2e+121) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (a * (b * -0.25));
double tmp;
if ((a * b) <= -2e+57) {
tmp = t_2;
} else if ((a * b) <= -2e-80) {
tmp = t_1;
} else if ((a * b) <= 2e-82) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+121) {
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 + (z * (t * 0.0625d0))
t_2 = c + (a * (b * (-0.25d0)))
if ((a * b) <= (-2d+57)) then
tmp = t_2
else if ((a * b) <= (-2d-80)) then
tmp = t_1
else if ((a * b) <= 2d-82) then
tmp = c + (x * y)
else if ((a * b) <= 2d+121) 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 + (z * (t * 0.0625));
double t_2 = c + (a * (b * -0.25));
double tmp;
if ((a * b) <= -2e+57) {
tmp = t_2;
} else if ((a * b) <= -2e-80) {
tmp = t_1;
} else if ((a * b) <= 2e-82) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+121) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) t_2 = c + (a * (b * -0.25)) tmp = 0 if (a * b) <= -2e+57: tmp = t_2 elif (a * b) <= -2e-80: tmp = t_1 elif (a * b) <= 2e-82: tmp = c + (x * y) elif (a * b) <= 2e+121: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(a * b) <= -2e+57) tmp = t_2; elseif (Float64(a * b) <= -2e-80) tmp = t_1; elseif (Float64(a * b) <= 2e-82) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e+121) 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 + (z * (t * 0.0625)); t_2 = c + (a * (b * -0.25)); tmp = 0.0; if ((a * b) <= -2e+57) tmp = t_2; elseif ((a * b) <= -2e-80) tmp = t_1; elseif ((a * b) <= 2e-82) tmp = c + (x * y); elseif ((a * b) <= 2e+121) 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[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+57], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2e-80], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e-82], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+121], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-82}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e57 or 2.00000000000000007e121 < (*.f64 a b) Initial program 94.2%
associate--l+94.2%
fma-define96.5%
associate-/l*97.7%
fmm-def98.8%
distribute-neg-frac298.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in a around inf 79.8%
*-commutative79.8%
associate-*r*79.8%
Simplified79.8%
if -2.0000000000000001e57 < (*.f64 a b) < -1.99999999999999992e-80 or 2e-82 < (*.f64 a b) < 2.00000000000000007e121Initial program 100.0%
Taylor expanded in a around 0 87.4%
Taylor expanded in t around inf 75.9%
associate-*r*75.9%
*-commutative75.9%
Simplified75.9%
if -1.99999999999999992e-80 < (*.f64 a b) < 2e-82Initial program 100.0%
Taylor expanded in a around 0 96.0%
Taylor expanded in t around 0 70.5%
+-commutative70.5%
Simplified70.5%
Final simplification75.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -2.25e+91)
(* x y)
(if (<= (* x y) 0.0)
c
(if (<= (* x y) 1.55e-30) (* b (* a -0.25)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2.25e+91) {
tmp = x * y;
} else if ((x * y) <= 0.0) {
tmp = c;
} else if ((x * y) <= 1.55e-30) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-2.25d+91)) then
tmp = x * y
else if ((x * y) <= 0.0d0) then
tmp = c
else if ((x * y) <= 1.55d-30) then
tmp = b * (a * (-0.25d0))
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2.25e+91) {
tmp = x * y;
} else if ((x * y) <= 0.0) {
tmp = c;
} else if ((x * y) <= 1.55e-30) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -2.25e+91: tmp = x * y elif (x * y) <= 0.0: tmp = c elif (x * y) <= 1.55e-30: tmp = b * (a * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -2.25e+91) tmp = Float64(x * y); elseif (Float64(x * y) <= 0.0) tmp = c; elseif (Float64(x * y) <= 1.55e-30) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -2.25e+91) tmp = x * y; elseif ((x * y) <= 0.0) tmp = c; elseif ((x * y) <= 1.55e-30) tmp = b * (a * -0.25); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.25e+91], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-30], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+91}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-30}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.25e91 or 1.54999999999999995e-30 < (*.f64 x y) Initial program 96.4%
Taylor expanded in a around 0 82.5%
Taylor expanded in y around inf 78.5%
associate-*r/78.5%
associate-*r*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in z around -inf 68.9%
mul-1-neg68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
+-commutative68.9%
mul-1-neg68.9%
unsub-neg68.9%
*-commutative68.9%
associate-/l*62.1%
Simplified62.1%
Taylor expanded in x around inf 51.8%
if -2.25e91 < (*.f64 x y) < 0.0Initial program 100.0%
Taylor expanded in c around inf 38.5%
if 0.0 < (*.f64 x y) < 1.54999999999999995e-30Initial program 97.3%
Taylor expanded in x around 0 95.8%
Taylor expanded in t around 0 76.2%
Taylor expanded in b around inf 68.6%
Taylor expanded in c around 0 49.2%
Final simplification45.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))) (t_2 (* z (* t 0.0625))))
(if (<= z -2.3e+82)
t_2
(if (<= z -3.85e-44)
t_1
(if (<= z -1.3e-246) (* x y) (if (<= z 1.1e-79) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double t_2 = z * (t * 0.0625);
double tmp;
if (z <= -2.3e+82) {
tmp = t_2;
} else if (z <= -3.85e-44) {
tmp = t_1;
} else if (z <= -1.3e-246) {
tmp = x * y;
} else if (z <= 1.1e-79) {
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 = b * (a * (-0.25d0))
t_2 = z * (t * 0.0625d0)
if (z <= (-2.3d+82)) then
tmp = t_2
else if (z <= (-3.85d-44)) then
tmp = t_1
else if (z <= (-1.3d-246)) then
tmp = x * y
else if (z <= 1.1d-79) 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 = b * (a * -0.25);
double t_2 = z * (t * 0.0625);
double tmp;
if (z <= -2.3e+82) {
tmp = t_2;
} else if (z <= -3.85e-44) {
tmp = t_1;
} else if (z <= -1.3e-246) {
tmp = x * y;
} else if (z <= 1.1e-79) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) t_2 = z * (t * 0.0625) tmp = 0 if z <= -2.3e+82: tmp = t_2 elif z <= -3.85e-44: tmp = t_1 elif z <= -1.3e-246: tmp = x * y elif z <= 1.1e-79: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) t_2 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (z <= -2.3e+82) tmp = t_2; elseif (z <= -3.85e-44) tmp = t_1; elseif (z <= -1.3e-246) tmp = Float64(x * y); elseif (z <= 1.1e-79) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b * (a * -0.25); t_2 = z * (t * 0.0625); tmp = 0.0; if (z <= -2.3e+82) tmp = t_2; elseif (z <= -3.85e-44) tmp = t_1; elseif (z <= -1.3e-246) tmp = x * y; elseif (z <= 1.1e-79) 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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+82], t$95$2, If[LessEqual[z, -3.85e-44], t$95$1, If[LessEqual[z, -1.3e-246], N[(x * y), $MachinePrecision], If[LessEqual[z, 1.1e-79], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+82}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.85 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-246}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.29999999999999988e82 or 1.0999999999999999e-79 < z Initial program 96.6%
Taylor expanded in a around 0 83.9%
Taylor expanded in y around inf 74.4%
associate-*r/74.4%
associate-*r*74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in z around -inf 84.8%
mul-1-neg84.8%
*-commutative84.8%
distribute-rgt-neg-in84.8%
+-commutative84.8%
mul-1-neg84.8%
unsub-neg84.8%
*-commutative84.8%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in t around inf 49.0%
associate-*r*49.0%
*-commutative49.0%
Simplified49.0%
if -2.29999999999999988e82 < z < -3.85000000000000015e-44 or -1.2999999999999999e-246 < z < 1.0999999999999999e-79Initial program 99.0%
Taylor expanded in x around 0 79.3%
Taylor expanded in t around 0 71.6%
Taylor expanded in b around inf 67.2%
Taylor expanded in c around 0 41.8%
if -3.85000000000000015e-44 < z < -1.2999999999999999e-246Initial program 100.0%
Taylor expanded in a around 0 76.1%
Taylor expanded in y around inf 73.0%
associate-*r/73.0%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in z around -inf 58.4%
mul-1-neg58.4%
*-commutative58.4%
distribute-rgt-neg-in58.4%
+-commutative58.4%
mul-1-neg58.4%
unsub-neg58.4%
*-commutative58.4%
associate-/l*55.5%
Simplified55.5%
Taylor expanded in x around inf 38.1%
Final simplification44.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+57) (not (<= (* a b) 2e+121))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -2e+57) || !((a * b) <= 2e+121)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-2d+57)) .or. (.not. ((a * b) <= 2d+121))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -2e+57) || !((a * b) <= 2e+121)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -2e+57) or not ((a * b) <= 2e+121): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -2e+57) || !(Float64(a * b) <= 2e+121)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -2e+57) || ~(((a * b) <= 2e+121))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+57], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+121]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+57} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+121}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e57 or 2.00000000000000007e121 < (*.f64 a b) Initial program 94.2%
Taylor expanded in z around 0 92.0%
if -2.0000000000000001e57 < (*.f64 a b) < 2.00000000000000007e121Initial program 100.0%
Taylor expanded in a around 0 92.4%
Final simplification92.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+57) (not (<= (* a b) 2e+121))) (+ c (- (* x y) (/ a (/ 4.0 b)))) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -2e+57) || !((a * b) <= 2e+121)) {
tmp = c + ((x * y) - (a / (4.0 / b)));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-2d+57)) .or. (.not. ((a * b) <= 2d+121))) then
tmp = c + ((x * y) - (a / (4.0d0 / b)))
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -2e+57) || !((a * b) <= 2e+121)) {
tmp = c + ((x * y) - (a / (4.0 / b)));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -2e+57) or not ((a * b) <= 2e+121): tmp = c + ((x * y) - (a / (4.0 / b))) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -2e+57) || !(Float64(a * b) <= 2e+121)) tmp = Float64(c + Float64(Float64(x * y) - Float64(a / Float64(4.0 / b)))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -2e+57) || ~(((a * b) <= 2e+121))) tmp = c + ((x * y) - (a / (4.0 / b))); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+57], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+121]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+57} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+121}\right):\\
\;\;\;\;c + \left(x \cdot y - \frac{a}{\frac{4}{b}}\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) < -2.0000000000000001e57 or 2.00000000000000007e121 < (*.f64 a b) Initial program 94.2%
associate-+l-94.2%
+-commutative94.2%
*-commutative94.2%
+-commutative94.2%
associate-+l-94.2%
fma-define95.4%
*-commutative95.4%
associate-/l*96.5%
associate-/l*96.5%
Simplified96.5%
clear-num96.5%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in x around inf 91.9%
if -2.0000000000000001e57 < (*.f64 a b) < 2.00000000000000007e121Initial program 100.0%
Taylor expanded in a around 0 92.4%
Final simplification92.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+167) (not (<= (* a b) 5e+124))) (+ c (* a (* b -0.25))) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+167) || !((a * b) <= 5e+124)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-1d+167)) .or. (.not. ((a * b) <= 5d+124))) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+167) || !((a * b) <= 5e+124)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1e+167) or not ((a * b) <= 5e+124): tmp = c + (a * (b * -0.25)) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1e+167) || !(Float64(a * b) <= 5e+124)) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1e+167) || ~(((a * b) <= 5e+124))) tmp = c + (a * (b * -0.25)); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+167], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+124]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+167} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+124}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1e167 or 4.9999999999999996e124 < (*.f64 a b) Initial program 92.4%
associate--l+92.4%
fma-define95.4%
associate-/l*96.9%
fmm-def98.5%
distribute-neg-frac298.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in a around inf 86.7%
*-commutative86.7%
associate-*r*86.7%
Simplified86.7%
if -1e167 < (*.f64 a b) < 4.9999999999999996e124Initial program 100.0%
Taylor expanded in a around 0 90.9%
Final simplification89.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (* (* a b) 0.25)))
(if (<= (* a b) -5e-37)
(- (+ c t_1) t_2)
(if (<= (* a b) 2e+121) (+ c (+ (* x y) t_1)) (- (+ c (* x y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -5e-37) {
tmp = (c + t_1) - t_2;
} else if ((a * b) <= 2e+121) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = (a * b) * 0.25d0
if ((a * b) <= (-5d-37)) then
tmp = (c + t_1) - t_2
else if ((a * b) <= 2d+121) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + (x * y)) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -5e-37) {
tmp = (c + t_1) - t_2;
} else if ((a * b) <= 2e+121) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (a * b) * 0.25 tmp = 0 if (a * b) <= -5e-37: tmp = (c + t_1) - t_2 elif (a * b) <= 2e+121: tmp = c + ((x * y) + t_1) else: tmp = (c + (x * y)) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (Float64(a * b) <= -5e-37) tmp = Float64(Float64(c + t_1) - t_2); elseif (Float64(a * b) <= 2e+121) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + Float64(x * y)) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (a * b) * 0.25; tmp = 0.0; if ((a * b) <= -5e-37) tmp = (c + t_1) - t_2; elseif ((a * b) <= 2e+121) tmp = c + ((x * y) + t_1); else tmp = (c + (x * y)) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e-37], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+121], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{-37}:\\
\;\;\;\;\left(c + t\_1\right) - t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+121}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999997e-37Initial program 95.7%
Taylor expanded in x around 0 87.5%
if -4.9999999999999997e-37 < (*.f64 a b) < 2.00000000000000007e121Initial program 100.0%
Taylor expanded in a around 0 93.4%
if 2.00000000000000007e121 < (*.f64 a b) Initial program 95.0%
Taylor expanded in z around 0 97.5%
Final simplification92.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3e+102) (not (<= (* x y) 7.5e+150))) (+ 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) <= -3e+102) || !((x * y) <= 7.5e+150)) {
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) <= (-3d+102)) .or. (.not. ((x * y) <= 7.5d+150))) 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) <= -3e+102) || !((x * y) <= 7.5e+150)) {
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) <= -3e+102) or not ((x * y) <= 7.5e+150): 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) <= -3e+102) || !(Float64(x * y) <= 7.5e+150)) 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) <= -3e+102) || ~(((x * y) <= 7.5e+150))) 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], -3e+102], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.5e+150]], $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 -3 \cdot 10^{+102} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+150}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.9999999999999998e102 or 7.4999999999999998e150 < (*.f64 x y) Initial program 94.4%
Taylor expanded in a around 0 84.9%
Taylor expanded in t around 0 74.1%
+-commutative74.1%
Simplified74.1%
if -2.9999999999999998e102 < (*.f64 x y) < 7.4999999999999998e150Initial program 99.4%
Taylor expanded in a around 0 68.9%
Taylor expanded in t around inf 60.7%
associate-*r*60.7%
*-commutative60.7%
Simplified60.7%
Final simplification64.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.8e+91) (not (<= (* x y) 3.1e-31))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.8e+91) || !((x * y) <= 3.1e-31)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-2.8d+91)) .or. (.not. ((x * y) <= 3.1d-31))) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.8e+91) || !((x * y) <= 3.1e-31)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.8e+91) or not ((x * y) <= 3.1e-31): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.8e+91) || !(Float64(x * y) <= 3.1e-31)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -2.8e+91) || ~(((x * y) <= 3.1e-31))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.8e+91], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.1e-31]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.8 \cdot 10^{+91} \lor \neg \left(x \cdot y \leq 3.1 \cdot 10^{-31}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.7999999999999999e91 or 3.1e-31 < (*.f64 x y) Initial program 96.4%
Taylor expanded in a around 0 82.5%
Taylor expanded in y around inf 78.5%
associate-*r/78.5%
associate-*r*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in z around -inf 68.9%
mul-1-neg68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
+-commutative68.9%
mul-1-neg68.9%
unsub-neg68.9%
*-commutative68.9%
associate-/l*62.1%
Simplified62.1%
Taylor expanded in x around inf 51.8%
if -2.7999999999999999e91 < (*.f64 x y) < 3.1e-31Initial program 99.3%
Taylor expanded in c around inf 36.1%
Final simplification43.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.96e+96) (not (<= a 3e-118))) (* b (* a -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.96e+96) || !(a <= 3e-118)) {
tmp = b * (a * -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.96d+96)) .or. (.not. (a <= 3d-118))) then
tmp = b * (a * (-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.96e+96) || !(a <= 3e-118)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.96e+96) or not (a <= 3e-118): tmp = b * (a * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.96e+96) || !(a <= 3e-118)) tmp = Float64(b * Float64(a * -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.96e+96) || ~((a <= 3e-118))) tmp = b * (a * -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.96e+96], N[Not[LessEqual[a, 3e-118]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.96 \cdot 10^{+96} \lor \neg \left(a \leq 3 \cdot 10^{-118}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.96e96 or 3.00000000000000018e-118 < a Initial program 96.1%
Taylor expanded in x around 0 81.5%
Taylor expanded in t around 0 62.7%
Taylor expanded in b around inf 55.6%
Taylor expanded in c around 0 46.8%
if -1.96e96 < a < 3.00000000000000018e-118Initial program 100.0%
Taylor expanded in a around 0 91.0%
Taylor expanded in t around 0 59.9%
+-commutative59.9%
Simplified59.9%
Final simplification53.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.0%
Taylor expanded in c around inf 25.6%
herbie shell --seed 2024191
(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))