
(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 12 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 t (/ z 16.0) (fma x y (- c (* b (/ a 4.0))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(t, (z / 16.0), fma(x, y, (c - (b * (a / 4.0)))));
}
function code(x, y, z, t, a, b, c) return fma(t, Float64(z / 16.0), fma(x, y, Float64(c - Float64(b * Float64(a / 4.0))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(t * N[(z / 16.0), $MachinePrecision] + N[(x * y + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Initial program 98.0%
associate-+l-98.0%
+-commutative98.0%
associate--l+98.0%
associate-*l/98.0%
*-commutative98.0%
fma-def98.8%
fma-neg98.8%
neg-sub098.8%
associate-+l-98.8%
neg-sub098.8%
+-commutative98.8%
unsub-neg98.8%
*-commutative98.8%
associate-*r/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))) (t_2 (* (* b a) -0.25)))
(if (<= (* b a) -1.08e+102)
t_2
(if (<= (* b a) -8.5e-195)
t_1
(if (<= (* b a) -8.2e-292)
c
(if (<= (* b a) 2.25e-184)
(* x y)
(if (<= (* b a) 8.8e+191) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double t_2 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -1.08e+102) {
tmp = t_2;
} else if ((b * a) <= -8.5e-195) {
tmp = t_1;
} else if ((b * a) <= -8.2e-292) {
tmp = c;
} else if ((b * a) <= 2.25e-184) {
tmp = x * y;
} else if ((b * a) <= 8.8e+191) {
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 = t * (z * 0.0625d0)
t_2 = (b * a) * (-0.25d0)
if ((b * a) <= (-1.08d+102)) then
tmp = t_2
else if ((b * a) <= (-8.5d-195)) then
tmp = t_1
else if ((b * a) <= (-8.2d-292)) then
tmp = c
else if ((b * a) <= 2.25d-184) then
tmp = x * y
else if ((b * a) <= 8.8d+191) 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 = t * (z * 0.0625);
double t_2 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -1.08e+102) {
tmp = t_2;
} else if ((b * a) <= -8.5e-195) {
tmp = t_1;
} else if ((b * a) <= -8.2e-292) {
tmp = c;
} else if ((b * a) <= 2.25e-184) {
tmp = x * y;
} else if ((b * a) <= 8.8e+191) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) t_2 = (b * a) * -0.25 tmp = 0 if (b * a) <= -1.08e+102: tmp = t_2 elif (b * a) <= -8.5e-195: tmp = t_1 elif (b * a) <= -8.2e-292: tmp = c elif (b * a) <= 2.25e-184: tmp = x * y elif (b * a) <= 8.8e+191: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) t_2 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -1.08e+102) tmp = t_2; elseif (Float64(b * a) <= -8.5e-195) tmp = t_1; elseif (Float64(b * a) <= -8.2e-292) tmp = c; elseif (Float64(b * a) <= 2.25e-184) tmp = Float64(x * y); elseif (Float64(b * a) <= 8.8e+191) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (z * 0.0625); t_2 = (b * a) * -0.25; tmp = 0.0; if ((b * a) <= -1.08e+102) tmp = t_2; elseif ((b * a) <= -8.5e-195) tmp = t_1; elseif ((b * a) <= -8.2e-292) tmp = c; elseif ((b * a) <= 2.25e-184) tmp = x * y; elseif ((b * a) <= 8.8e+191) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1.08e+102], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -8.5e-195], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -8.2e-292], c, If[LessEqual[N[(b * a), $MachinePrecision], 2.25e-184], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 8.8e+191], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -1.08 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -8.5 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -8.2 \cdot 10^{-292}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \cdot a \leq 2.25 \cdot 10^{-184}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 8.8 \cdot 10^{+191}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.08000000000000002e102 or 8.80000000000000001e191 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0 92.5%
Taylor expanded in a around inf 79.0%
*-commutative79.0%
Simplified79.0%
if -1.08000000000000002e102 < (*.f64 a b) < -8.50000000000000023e-195 or 2.2500000000000001e-184 < (*.f64 a b) < 8.80000000000000001e191Initial program 100.0%
Taylor expanded in x around 0 72.7%
Taylor expanded in t around inf 44.2%
associate-*r*44.2%
*-commutative44.2%
associate-*l*44.2%
Simplified44.2%
if -8.50000000000000023e-195 < (*.f64 a b) < -8.20000000000000087e-292Initial program 100.0%
Taylor expanded in c around inf 61.1%
if -8.20000000000000087e-292 < (*.f64 a b) < 2.2500000000000001e-184Initial program 100.0%
Taylor expanded in z around 0 83.9%
Taylor expanded in y around inf 57.2%
Final simplification57.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* t z)))) (t_2 (- (* x y) (* (* b a) 0.25))))
(if (<= (* b a) -2.8e+98)
t_2
(if (<= (* b a) -2.5e-56)
t_1
(if (<= (* b a) 6e-184)
(+ c (* x y))
(if (<= (* b a) 1.8e+31) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (t * z));
double t_2 = (x * y) - ((b * a) * 0.25);
double tmp;
if ((b * a) <= -2.8e+98) {
tmp = t_2;
} else if ((b * a) <= -2.5e-56) {
tmp = t_1;
} else if ((b * a) <= 6e-184) {
tmp = c + (x * y);
} else if ((b * a) <= 1.8e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (0.0625d0 * (t * z))
t_2 = (x * y) - ((b * a) * 0.25d0)
if ((b * a) <= (-2.8d+98)) then
tmp = t_2
else if ((b * a) <= (-2.5d-56)) then
tmp = t_1
else if ((b * a) <= 6d-184) then
tmp = c + (x * y)
else if ((b * a) <= 1.8d+31) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (t * z));
double t_2 = (x * y) - ((b * a) * 0.25);
double tmp;
if ((b * a) <= -2.8e+98) {
tmp = t_2;
} else if ((b * a) <= -2.5e-56) {
tmp = t_1;
} else if ((b * a) <= 6e-184) {
tmp = c + (x * y);
} else if ((b * a) <= 1.8e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (t * z)) t_2 = (x * y) - ((b * a) * 0.25) tmp = 0 if (b * a) <= -2.8e+98: tmp = t_2 elif (b * a) <= -2.5e-56: tmp = t_1 elif (b * a) <= 6e-184: tmp = c + (x * y) elif (b * a) <= 1.8e+31: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(t * z))) t_2 = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)) tmp = 0.0 if (Float64(b * a) <= -2.8e+98) tmp = t_2; elseif (Float64(b * a) <= -2.5e-56) tmp = t_1; elseif (Float64(b * a) <= 6e-184) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 1.8e+31) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (0.0625 * (t * z)); t_2 = (x * y) - ((b * a) * 0.25); tmp = 0.0; if ((b * a) <= -2.8e+98) tmp = t_2; elseif ((b * a) <= -2.5e-56) tmp = t_1; elseif ((b * a) <= 6e-184) tmp = c + (x * y); elseif ((b * a) <= 1.8e+31) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -2.8e+98], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -2.5e-56], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 6e-184], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 1.8e+31], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(t \cdot z\right)\\
t_2 := x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -2.8 \cdot 10^{+98}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -2.5 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 6 \cdot 10^{-184}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 1.8 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.8000000000000001e98 or 1.79999999999999998e31 < (*.f64 a b) Initial program 95.2%
Taylor expanded in z around 0 87.1%
Taylor expanded in c around 0 82.3%
if -2.8000000000000001e98 < (*.f64 a b) < -2.49999999999999999e-56 or 5.99999999999999982e-184 < (*.f64 a b) < 1.79999999999999998e31Initial program 100.0%
Taylor expanded in z around inf 72.6%
if -2.49999999999999999e-56 < (*.f64 a b) < 5.99999999999999982e-184Initial program 100.0%
Taylor expanded in x around inf 79.8%
Final simplification78.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* (* b a) -0.25)))
(if (<= (* b a) -8.5e+143)
t_2
(if (<= (* b a) 3.1e-177)
t_1
(if (<= (* b a) 5.5e-87)
(* t (* z 0.0625))
(if (<= (* b a) 2.3e+180) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -8.5e+143) {
tmp = t_2;
} else if ((b * a) <= 3.1e-177) {
tmp = t_1;
} else if ((b * a) <= 5.5e-87) {
tmp = t * (z * 0.0625);
} else if ((b * a) <= 2.3e+180) {
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 + (x * y)
t_2 = (b * a) * (-0.25d0)
if ((b * a) <= (-8.5d+143)) then
tmp = t_2
else if ((b * a) <= 3.1d-177) then
tmp = t_1
else if ((b * a) <= 5.5d-87) then
tmp = t * (z * 0.0625d0)
else if ((b * a) <= 2.3d+180) 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 + (x * y);
double t_2 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -8.5e+143) {
tmp = t_2;
} else if ((b * a) <= 3.1e-177) {
tmp = t_1;
} else if ((b * a) <= 5.5e-87) {
tmp = t * (z * 0.0625);
} else if ((b * a) <= 2.3e+180) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = (b * a) * -0.25 tmp = 0 if (b * a) <= -8.5e+143: tmp = t_2 elif (b * a) <= 3.1e-177: tmp = t_1 elif (b * a) <= 5.5e-87: tmp = t * (z * 0.0625) elif (b * a) <= 2.3e+180: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -8.5e+143) tmp = t_2; elseif (Float64(b * a) <= 3.1e-177) tmp = t_1; elseif (Float64(b * a) <= 5.5e-87) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(b * a) <= 2.3e+180) 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 + (x * y); t_2 = (b * a) * -0.25; tmp = 0.0; if ((b * a) <= -8.5e+143) tmp = t_2; elseif ((b * a) <= 3.1e-177) tmp = t_1; elseif ((b * a) <= 5.5e-87) tmp = t * (z * 0.0625); elseif ((b * a) <= 2.3e+180) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -8.5e+143], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 3.1e-177], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 5.5e-87], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2.3e+180], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -8.5 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq 3.1 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-87}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;b \cdot a \leq 2.3 \cdot 10^{+180}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -8.4999999999999998e143 or 2.2999999999999999e180 < (*.f64 a b) Initial program 93.2%
Taylor expanded in z around 0 89.7%
Taylor expanded in a around inf 79.7%
*-commutative79.7%
Simplified79.7%
if -8.4999999999999998e143 < (*.f64 a b) < 3.10000000000000018e-177 or 5.5000000000000004e-87 < (*.f64 a b) < 2.2999999999999999e180Initial program 100.0%
Taylor expanded in x around inf 65.9%
if 3.10000000000000018e-177 < (*.f64 a b) < 5.5000000000000004e-87Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in t around inf 83.4%
associate-*r*83.4%
*-commutative83.4%
associate-*l*83.4%
Simplified83.4%
Final simplification71.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) -0.25)))
(if (<= (* b a) -7.8e+152)
t_1
(if (<= (* b a) 1.2e-183)
(+ c (* x y))
(if (<= (* b a) 9e+194) (+ c (* 0.0625 (* t z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -7.8e+152) {
tmp = t_1;
} else if ((b * a) <= 1.2e-183) {
tmp = c + (x * y);
} else if ((b * a) <= 9e+194) {
tmp = c + (0.0625 * (t * z));
} 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 = (b * a) * (-0.25d0)
if ((b * a) <= (-7.8d+152)) then
tmp = t_1
else if ((b * a) <= 1.2d-183) then
tmp = c + (x * y)
else if ((b * a) <= 9d+194) then
tmp = c + (0.0625d0 * (t * z))
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 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -7.8e+152) {
tmp = t_1;
} else if ((b * a) <= 1.2e-183) {
tmp = c + (x * y);
} else if ((b * a) <= 9e+194) {
tmp = c + (0.0625 * (t * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * -0.25 tmp = 0 if (b * a) <= -7.8e+152: tmp = t_1 elif (b * a) <= 1.2e-183: tmp = c + (x * y) elif (b * a) <= 9e+194: tmp = c + (0.0625 * (t * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -7.8e+152) tmp = t_1; elseif (Float64(b * a) <= 1.2e-183) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 9e+194) tmp = Float64(c + Float64(0.0625 * Float64(t * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * -0.25; tmp = 0.0; if ((b * a) <= -7.8e+152) tmp = t_1; elseif ((b * a) <= 1.2e-183) tmp = c + (x * y); elseif ((b * a) <= 9e+194) tmp = c + (0.0625 * (t * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -7.8e+152], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 1.2e-183], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 9e+194], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -7.8 \cdot 10^{+152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 1.2 \cdot 10^{-183}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 9 \cdot 10^{+194}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -7.80000000000000022e152 or 8.9999999999999997e194 < (*.f64 a b) Initial program 93.1%
Taylor expanded in z around 0 92.0%
Taylor expanded in a around inf 81.8%
*-commutative81.8%
Simplified81.8%
if -7.80000000000000022e152 < (*.f64 a b) < 1.19999999999999996e-183Initial program 100.0%
Taylor expanded in x around inf 69.9%
if 1.19999999999999996e-183 < (*.f64 a b) < 8.9999999999999997e194Initial program 100.0%
Taylor expanded in z around inf 66.3%
Final simplification72.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) -0.25)))
(if (<= (* b a) -9.4e+147)
(+ c t_1)
(if (<= (* b a) 5.5e-179)
(+ c (* x y))
(if (<= (* b a) 6.3e+199) (+ c (* 0.0625 (* t z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -9.4e+147) {
tmp = c + t_1;
} else if ((b * a) <= 5.5e-179) {
tmp = c + (x * y);
} else if ((b * a) <= 6.3e+199) {
tmp = c + (0.0625 * (t * z));
} 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 = (b * a) * (-0.25d0)
if ((b * a) <= (-9.4d+147)) then
tmp = c + t_1
else if ((b * a) <= 5.5d-179) then
tmp = c + (x * y)
else if ((b * a) <= 6.3d+199) then
tmp = c + (0.0625d0 * (t * z))
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 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -9.4e+147) {
tmp = c + t_1;
} else if ((b * a) <= 5.5e-179) {
tmp = c + (x * y);
} else if ((b * a) <= 6.3e+199) {
tmp = c + (0.0625 * (t * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * -0.25 tmp = 0 if (b * a) <= -9.4e+147: tmp = c + t_1 elif (b * a) <= 5.5e-179: tmp = c + (x * y) elif (b * a) <= 6.3e+199: tmp = c + (0.0625 * (t * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -9.4e+147) tmp = Float64(c + t_1); elseif (Float64(b * a) <= 5.5e-179) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 6.3e+199) tmp = Float64(c + Float64(0.0625 * Float64(t * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * -0.25; tmp = 0.0; if ((b * a) <= -9.4e+147) tmp = c + t_1; elseif ((b * a) <= 5.5e-179) tmp = c + (x * y); elseif ((b * a) <= 6.3e+199) tmp = c + (0.0625 * (t * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -9.4e+147], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 5.5e-179], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 6.3e+199], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -9.4 \cdot 10^{+147}:\\
\;\;\;\;c + t_1\\
\mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-179}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 6.3 \cdot 10^{+199}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.4000000000000006e147Initial program 92.7%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -9.4000000000000006e147 < (*.f64 a b) < 5.5000000000000003e-179Initial program 100.0%
Taylor expanded in x around inf 69.9%
if 5.5000000000000003e-179 < (*.f64 a b) < 6.2999999999999999e199Initial program 100.0%
Taylor expanded in z around inf 66.3%
if 6.2999999999999999e199 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0 87.6%
Taylor expanded in a around inf 81.2%
*-commutative81.2%
Simplified81.2%
Final simplification73.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -1.05e+104) (not (<= (* b a) 2.3e+198))) (- (* x y) (* (* b a) 0.25)) (+ c (+ (* x y) (* 0.0625 (* t z))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -1.05e+104) || !((b * a) <= 2.3e+198)) {
tmp = (x * y) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (t * z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((b * a) <= (-1.05d+104)) .or. (.not. ((b * a) <= 2.3d+198))) then
tmp = (x * y) - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (t * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -1.05e+104) || !((b * a) <= 2.3e+198)) {
tmp = (x * y) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (t * z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -1.05e+104) or not ((b * a) <= 2.3e+198): tmp = (x * y) - ((b * a) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (t * z))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -1.05e+104) || !(Float64(b * a) <= 2.3e+198)) tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(t * z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -1.05e+104) || ~(((b * a) <= 2.3e+198))) tmp = (x * y) - ((b * a) * 0.25); else tmp = c + ((x * y) + (0.0625 * (t * z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -1.05e+104], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2.3e+198]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.05 \cdot 10^{+104} \lor \neg \left(b \cdot a \leq 2.3 \cdot 10^{+198}\right):\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.0499999999999999e104 or 2.3000000000000001e198 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0 92.5%
Taylor expanded in c around 0 90.3%
if -1.0499999999999999e104 < (*.f64 a b) < 2.3000000000000001e198Initial program 100.0%
Taylor expanded in a around 0 92.7%
Final simplification92.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)))
(if (<= (* b a) -2.3e+99)
(- (+ c (* x y)) t_1)
(if (<= (* b a) 6.8e+191)
(+ c (+ (* x y) (* 0.0625 (* t z))))
(- (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double tmp;
if ((b * a) <= -2.3e+99) {
tmp = (c + (x * y)) - t_1;
} else if ((b * a) <= 6.8e+191) {
tmp = c + ((x * y) + (0.0625 * (t * z)));
} else {
tmp = (x * y) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (b * a) * 0.25d0
if ((b * a) <= (-2.3d+99)) then
tmp = (c + (x * y)) - t_1
else if ((b * a) <= 6.8d+191) then
tmp = c + ((x * y) + (0.0625d0 * (t * z)))
else
tmp = (x * y) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double tmp;
if ((b * a) <= -2.3e+99) {
tmp = (c + (x * y)) - t_1;
} else if ((b * a) <= 6.8e+191) {
tmp = c + ((x * y) + (0.0625 * (t * z)));
} else {
tmp = (x * y) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 tmp = 0 if (b * a) <= -2.3e+99: tmp = (c + (x * y)) - t_1 elif (b * a) <= 6.8e+191: tmp = c + ((x * y) + (0.0625 * (t * z))) else: tmp = (x * y) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) tmp = 0.0 if (Float64(b * a) <= -2.3e+99) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(b * a) <= 6.8e+191) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(t * z)))); else tmp = Float64(Float64(x * y) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * 0.25; tmp = 0.0; if ((b * a) <= -2.3e+99) tmp = (c + (x * y)) - t_1; elseif ((b * a) <= 6.8e+191) tmp = c + ((x * y) + (0.0625 * (t * z))); else tmp = (x * y) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -2.3e+99], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 6.8e+191], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -2.3 \cdot 10^{+99}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;b \cdot a \leq 6.8 \cdot 10^{+191}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.30000000000000019e99Initial program 93.5%
Taylor expanded in z around 0 95.8%
if -2.30000000000000019e99 < (*.f64 a b) < 6.80000000000000018e191Initial program 100.0%
Taylor expanded in a around 0 92.7%
if 6.80000000000000018e191 < (*.f64 a b) Initial program 93.5%
Taylor expanded in z around 0 87.6%
Taylor expanded in c around 0 87.6%
Final simplification92.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))))
(if (<= y -3.15e-83)
(* x y)
(if (<= y -9.5e-285)
t_1
(if (<= y 1.35e-268)
c
(if (<= y 2.5e+70)
t_1
(if (<= y 6.5e+105) c (if (<= y 4.8e+131) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double tmp;
if (y <= -3.15e-83) {
tmp = x * y;
} else if (y <= -9.5e-285) {
tmp = t_1;
} else if (y <= 1.35e-268) {
tmp = c;
} else if (y <= 2.5e+70) {
tmp = t_1;
} else if (y <= 6.5e+105) {
tmp = c;
} else if (y <= 4.8e+131) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = t * (z * 0.0625d0)
if (y <= (-3.15d-83)) then
tmp = x * y
else if (y <= (-9.5d-285)) then
tmp = t_1
else if (y <= 1.35d-268) then
tmp = c
else if (y <= 2.5d+70) then
tmp = t_1
else if (y <= 6.5d+105) then
tmp = c
else if (y <= 4.8d+131) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double tmp;
if (y <= -3.15e-83) {
tmp = x * y;
} else if (y <= -9.5e-285) {
tmp = t_1;
} else if (y <= 1.35e-268) {
tmp = c;
} else if (y <= 2.5e+70) {
tmp = t_1;
} else if (y <= 6.5e+105) {
tmp = c;
} else if (y <= 4.8e+131) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) tmp = 0 if y <= -3.15e-83: tmp = x * y elif y <= -9.5e-285: tmp = t_1 elif y <= 1.35e-268: tmp = c elif y <= 2.5e+70: tmp = t_1 elif y <= 6.5e+105: tmp = c elif y <= 4.8e+131: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (y <= -3.15e-83) tmp = Float64(x * y); elseif (y <= -9.5e-285) tmp = t_1; elseif (y <= 1.35e-268) tmp = c; elseif (y <= 2.5e+70) tmp = t_1; elseif (y <= 6.5e+105) tmp = c; elseif (y <= 4.8e+131) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (z * 0.0625); tmp = 0.0; if (y <= -3.15e-83) tmp = x * y; elseif (y <= -9.5e-285) tmp = t_1; elseif (y <= 1.35e-268) tmp = c; elseif (y <= 2.5e+70) tmp = t_1; elseif (y <= 6.5e+105) tmp = c; elseif (y <= 4.8e+131) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.15e-83], N[(x * y), $MachinePrecision], If[LessEqual[y, -9.5e-285], t$95$1, If[LessEqual[y, 1.35e-268], c, If[LessEqual[y, 2.5e+70], t$95$1, If[LessEqual[y, 6.5e+105], c, If[LessEqual[y, 4.8e+131], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;y \leq -3.15 \cdot 10^{-83}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-268}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+105}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -3.14999999999999983e-83 or 4.7999999999999999e131 < y Initial program 97.5%
Taylor expanded in z around 0 75.4%
Taylor expanded in y around inf 49.0%
if -3.14999999999999983e-83 < y < -9.4999999999999997e-285 or 1.35e-268 < y < 2.5000000000000001e70 or 6.50000000000000049e105 < y < 4.7999999999999999e131Initial program 99.1%
Taylor expanded in x around 0 86.7%
Taylor expanded in t around inf 30.6%
associate-*r*30.6%
*-commutative30.6%
associate-*l*30.6%
Simplified30.6%
if -9.4999999999999997e-285 < y < 1.35e-268 or 2.5000000000000001e70 < y < 6.50000000000000049e105Initial program 94.4%
Taylor expanded in c around inf 48.8%
Final simplification40.6%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 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 + ((((t * z) / 16.0d0) + (x * y)) - ((b * a) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -1.8e-158) (* x y) (if (<= y 6.8e+114) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -1.8e-158) {
tmp = x * y;
} else if (y <= 6.8e+114) {
tmp = c;
} 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 <= (-1.8d-158)) then
tmp = x * y
else if (y <= 6.8d+114) then
tmp = c
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 <= -1.8e-158) {
tmp = x * y;
} else if (y <= 6.8e+114) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -1.8e-158: tmp = x * y elif y <= 6.8e+114: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -1.8e-158) tmp = Float64(x * y); elseif (y <= 6.8e+114) tmp = c; 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 <= -1.8e-158) tmp = x * y; elseif (y <= 6.8e+114) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -1.8e-158], N[(x * y), $MachinePrecision], If[LessEqual[y, 6.8e+114], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-158}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+114}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.79999999999999995e-158 or 6.8000000000000001e114 < y Initial program 97.3%
Taylor expanded in z around 0 74.0%
Taylor expanded in y around inf 42.6%
if -1.79999999999999995e-158 < y < 6.8000000000000001e114Initial program 99.0%
Taylor expanded in c around inf 28.5%
Final simplification36.8%
(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 18.9%
Final simplification18.9%
herbie shell --seed 2023185
(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))