
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 98.0%
associate--l+98.0%
fma-define98.8%
associate-/l*98.8%
fmm-def98.8%
distribute-neg-frac298.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 98.0%
associate-+l-98.0%
+-commutative98.0%
*-commutative98.0%
+-commutative98.0%
associate-+l-98.0%
fma-define98.4%
*-commutative98.4%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -200000000000.0)
(* x y)
(if (<= (* x y) -7.5e-26)
t_1
(if (<= (* x y) -1.38e-118)
c
(if (<= (* x y) -8.2e-138)
t_1
(if (<= (* x y) 1.65e-274)
(* b (* a -0.25))
(if (<= (* x y) 4.1e+173) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -200000000000.0) {
tmp = x * y;
} else if ((x * y) <= -7.5e-26) {
tmp = t_1;
} else if ((x * y) <= -1.38e-118) {
tmp = c;
} else if ((x * y) <= -8.2e-138) {
tmp = t_1;
} else if ((x * y) <= 1.65e-274) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 4.1e+173) {
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 = 0.0625d0 * (z * t)
if ((x * y) <= (-200000000000.0d0)) then
tmp = x * y
else if ((x * y) <= (-7.5d-26)) then
tmp = t_1
else if ((x * y) <= (-1.38d-118)) then
tmp = c
else if ((x * y) <= (-8.2d-138)) then
tmp = t_1
else if ((x * y) <= 1.65d-274) then
tmp = b * (a * (-0.25d0))
else if ((x * y) <= 4.1d+173) 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 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -200000000000.0) {
tmp = x * y;
} else if ((x * y) <= -7.5e-26) {
tmp = t_1;
} else if ((x * y) <= -1.38e-118) {
tmp = c;
} else if ((x * y) <= -8.2e-138) {
tmp = t_1;
} else if ((x * y) <= 1.65e-274) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 4.1e+173) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -200000000000.0: tmp = x * y elif (x * y) <= -7.5e-26: tmp = t_1 elif (x * y) <= -1.38e-118: tmp = c elif (x * y) <= -8.2e-138: tmp = t_1 elif (x * y) <= 1.65e-274: tmp = b * (a * -0.25) elif (x * y) <= 4.1e+173: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -200000000000.0) tmp = Float64(x * y); elseif (Float64(x * y) <= -7.5e-26) tmp = t_1; elseif (Float64(x * y) <= -1.38e-118) tmp = c; elseif (Float64(x * y) <= -8.2e-138) tmp = t_1; elseif (Float64(x * y) <= 1.65e-274) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(x * y) <= 4.1e+173) 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 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -200000000000.0) tmp = x * y; elseif ((x * y) <= -7.5e-26) tmp = t_1; elseif ((x * y) <= -1.38e-118) tmp = c; elseif ((x * y) <= -8.2e-138) tmp = t_1; elseif ((x * y) <= 1.65e-274) tmp = b * (a * -0.25); elseif ((x * y) <= 4.1e+173) 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -200000000000.0], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -7.5e-26], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.38e-118], c, If[LessEqual[N[(x * y), $MachinePrecision], -8.2e-138], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.65e-274], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.1e+173], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -200000000000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -7.5 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.38 \cdot 10^{-118}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{-274}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2e11 or 4.09999999999999976e173 < (*.f64 x y) Initial program 95.9%
Taylor expanded in z around inf 83.4%
Taylor expanded in a around 0 75.7%
Taylor expanded in x around inf 66.8%
if -2e11 < (*.f64 x y) < -7.4999999999999994e-26 or -1.37999999999999991e-118 < (*.f64 x y) < -8.19999999999999998e-138 or 1.6499999999999999e-274 < (*.f64 x y) < 4.09999999999999976e173Initial program 98.7%
Taylor expanded in z around inf 98.6%
Taylor expanded in a around 0 80.5%
Taylor expanded in z around inf 56.1%
if -7.4999999999999994e-26 < (*.f64 x y) < -1.37999999999999991e-118Initial program 100.0%
Taylor expanded in c around inf 49.1%
if -8.19999999999999998e-138 < (*.f64 x y) < 1.6499999999999999e-274Initial program 100.0%
Taylor expanded in x around 0 98.6%
Taylor expanded in a around inf 43.2%
associate-*r*43.2%
*-commutative43.2%
Simplified43.2%
Final simplification56.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -220000000000.0)
t_2
(if (<= (* x y) -4.5e-143)
t_1
(if (<= (* x y) 1.5e-268)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 3.2e+173) 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 + (x * y);
double tmp;
if ((x * y) <= -220000000000.0) {
tmp = t_2;
} else if ((x * y) <= -4.5e-143) {
tmp = t_1;
} else if ((x * y) <= 1.5e-268) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 3.2e+173) {
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 + (x * y)
if ((x * y) <= (-220000000000.0d0)) then
tmp = t_2
else if ((x * y) <= (-4.5d-143)) then
tmp = t_1
else if ((x * y) <= 1.5d-268) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 3.2d+173) 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 + (x * y);
double tmp;
if ((x * y) <= -220000000000.0) {
tmp = t_2;
} else if ((x * y) <= -4.5e-143) {
tmp = t_1;
} else if ((x * y) <= 1.5e-268) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 3.2e+173) {
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 + (x * y) tmp = 0 if (x * y) <= -220000000000.0: tmp = t_2 elif (x * y) <= -4.5e-143: tmp = t_1 elif (x * y) <= 1.5e-268: tmp = c + (b * (a * -0.25)) elif (x * y) <= 3.2e+173: 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(x * y)) tmp = 0.0 if (Float64(x * y) <= -220000000000.0) tmp = t_2; elseif (Float64(x * y) <= -4.5e-143) tmp = t_1; elseif (Float64(x * y) <= 1.5e-268) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 3.2e+173) 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 + (x * y); tmp = 0.0; if ((x * y) <= -220000000000.0) tmp = t_2; elseif ((x * y) <= -4.5e-143) tmp = t_1; elseif ((x * y) <= 1.5e-268) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 3.2e+173) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -220000000000.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-143], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.5e-268], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+173], 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 + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -220000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{-268}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.2e11 or 3.2000000000000003e173 < (*.f64 x y) Initial program 95.9%
Taylor expanded in a around 0 83.3%
Taylor expanded in t around 0 77.6%
if -2.2e11 < (*.f64 x y) < -4.5e-143 or 1.4999999999999999e-268 < (*.f64 x y) < 3.2000000000000003e173Initial program 98.9%
Taylor expanded in a around 0 78.8%
Taylor expanded in x around 0 71.1%
associate-*r*71.1%
*-commutative71.1%
Simplified71.1%
if -4.5e-143 < (*.f64 x y) < 1.4999999999999999e-268Initial program 100.0%
Taylor expanded in a around inf 76.9%
associate-*r*76.9%
*-commutative76.9%
*-commutative76.9%
Simplified76.9%
Final simplification75.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -235000000000.0)
(* x y)
(if (<= (* x y) -1.45e-26)
t_1
(if (<= (* x y) 8.5e-275) c (if (<= (* x y) 5.8e+173) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -235000000000.0) {
tmp = x * y;
} else if ((x * y) <= -1.45e-26) {
tmp = t_1;
} else if ((x * y) <= 8.5e-275) {
tmp = c;
} else if ((x * y) <= 5.8e+173) {
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 = 0.0625d0 * (z * t)
if ((x * y) <= (-235000000000.0d0)) then
tmp = x * y
else if ((x * y) <= (-1.45d-26)) then
tmp = t_1
else if ((x * y) <= 8.5d-275) then
tmp = c
else if ((x * y) <= 5.8d+173) 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 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -235000000000.0) {
tmp = x * y;
} else if ((x * y) <= -1.45e-26) {
tmp = t_1;
} else if ((x * y) <= 8.5e-275) {
tmp = c;
} else if ((x * y) <= 5.8e+173) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -235000000000.0: tmp = x * y elif (x * y) <= -1.45e-26: tmp = t_1 elif (x * y) <= 8.5e-275: tmp = c elif (x * y) <= 5.8e+173: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -235000000000.0) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.45e-26) tmp = t_1; elseif (Float64(x * y) <= 8.5e-275) tmp = c; elseif (Float64(x * y) <= 5.8e+173) 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 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -235000000000.0) tmp = x * y; elseif ((x * y) <= -1.45e-26) tmp = t_1; elseif ((x * y) <= 8.5e-275) tmp = c; elseif ((x * y) <= 5.8e+173) 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -235000000000.0], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.45e-26], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.5e-275], c, If[LessEqual[N[(x * y), $MachinePrecision], 5.8e+173], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -235000000000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-275}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.35e11 or 5.80000000000000014e173 < (*.f64 x y) Initial program 95.9%
Taylor expanded in z around inf 83.4%
Taylor expanded in a around 0 75.7%
Taylor expanded in x around inf 66.8%
if -2.35e11 < (*.f64 x y) < -1.4499999999999999e-26 or 8.49999999999999952e-275 < (*.f64 x y) < 5.80000000000000014e173Initial program 98.6%
Taylor expanded in z around inf 98.6%
Taylor expanded in a around 0 79.1%
Taylor expanded in z around inf 54.4%
if -1.4499999999999999e-26 < (*.f64 x y) < 8.49999999999999952e-275Initial program 100.0%
Taylor expanded in c around inf 38.3%
Final simplification53.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -2e-25)
(+ (* x y) (* 0.0625 (* z t)))
(if (<= (* x y) 2e-283)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 4e+173) (+ c (* z (* t 0.0625))) (+ c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2e-25) {
tmp = (x * y) + (0.0625 * (z * t));
} else if ((x * y) <= 2e-283) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 4e+173) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-2d-25)) then
tmp = (x * y) + (0.0625d0 * (z * t))
else if ((x * y) <= 2d-283) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 4d+173) then
tmp = c + (z * (t * 0.0625d0))
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2e-25) {
tmp = (x * y) + (0.0625 * (z * t));
} else if ((x * y) <= 2e-283) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 4e+173) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -2e-25: tmp = (x * y) + (0.0625 * (z * t)) elif (x * y) <= 2e-283: tmp = c + (b * (a * -0.25)) elif (x * y) <= 4e+173: tmp = c + (z * (t * 0.0625)) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -2e-25) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 2e-283) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 4e+173) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -2e-25) tmp = (x * y) + (0.0625 * (z * t)); elseif ((x * y) <= 2e-283) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 4e+173) tmp = c + (z * (t * 0.0625)); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e-25], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-283], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+173], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-283}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+173}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000008e-25Initial program 94.7%
Taylor expanded in a around 0 79.4%
Taylor expanded in y around inf 77.0%
Taylor expanded in c around 0 70.4%
Taylor expanded in y around 0 70.4%
if -2.00000000000000008e-25 < (*.f64 x y) < 1.99999999999999989e-283Initial program 100.0%
Taylor expanded in a around inf 73.9%
associate-*r*73.9%
*-commutative73.9%
*-commutative73.9%
Simplified73.9%
if 1.99999999999999989e-283 < (*.f64 x y) < 4.0000000000000001e173Initial program 98.3%
Taylor expanded in a around 0 76.6%
Taylor expanded in x around 0 70.9%
associate-*r*70.9%
*-commutative70.9%
Simplified70.9%
if 4.0000000000000001e173 < (*.f64 x y) Initial program 100.0%
Taylor expanded in a around 0 94.7%
Taylor expanded in t around 0 89.4%
Final simplification74.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* x y) -5e+24)
(- (+ c (* x y)) t_1)
(if (<= (* x y) 1e+52) (- (+ c t_2) 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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -5e+24) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 1e+52) {
tmp = (c + t_2) - 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 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((x * y) <= (-5d+24)) then
tmp = (c + (x * y)) - t_1
else if ((x * y) <= 1d+52) then
tmp = (c + t_2) - 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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -5e+24) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 1e+52) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -5e+24: tmp = (c + (x * y)) - t_1 elif (x * y) <= 1e+52: tmp = (c + t_2) - t_1 else: tmp = c + ((x * y) + t_2) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -5e+24) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(x * y) <= 1e+52) tmp = Float64(Float64(c + t_2) - t_1); else tmp = Float64(c + Float64(Float64(x * y) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -5e+24) tmp = (c + (x * y)) - t_1; elseif ((x * y) <= 1e+52) tmp = (c + t_2) - 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[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+24], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+52], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+24}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+52}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000045e24Initial program 93.4%
Taylor expanded in z around 0 87.3%
if -5.00000000000000045e24 < (*.f64 x y) < 9.9999999999999999e51Initial program 99.3%
Taylor expanded in x around 0 95.6%
if 9.9999999999999999e51 < (*.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 93.9%
Final simplification93.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* z t))))
(if (<= z -3.8e+214)
t_2
(if (<= z -9e-294)
t_1
(if (<= z 3.6e-271) (* b (* a -0.25)) (if (<= z 2.45e-79) 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 = 0.0625 * (z * t);
double tmp;
if (z <= -3.8e+214) {
tmp = t_2;
} else if (z <= -9e-294) {
tmp = t_1;
} else if (z <= 3.6e-271) {
tmp = b * (a * -0.25);
} else if (z <= 2.45e-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 = c + (x * y)
t_2 = 0.0625d0 * (z * t)
if (z <= (-3.8d+214)) then
tmp = t_2
else if (z <= (-9d-294)) then
tmp = t_1
else if (z <= 3.6d-271) then
tmp = b * (a * (-0.25d0))
else if (z <= 2.45d-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 = c + (x * y);
double t_2 = 0.0625 * (z * t);
double tmp;
if (z <= -3.8e+214) {
tmp = t_2;
} else if (z <= -9e-294) {
tmp = t_1;
} else if (z <= 3.6e-271) {
tmp = b * (a * -0.25);
} else if (z <= 2.45e-79) {
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 = 0.0625 * (z * t) tmp = 0 if z <= -3.8e+214: tmp = t_2 elif z <= -9e-294: tmp = t_1 elif z <= 3.6e-271: tmp = b * (a * -0.25) elif z <= 2.45e-79: 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(0.0625 * Float64(z * t)) tmp = 0.0 if (z <= -3.8e+214) tmp = t_2; elseif (z <= -9e-294) tmp = t_1; elseif (z <= 3.6e-271) tmp = Float64(b * Float64(a * -0.25)); elseif (z <= 2.45e-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 = c + (x * y); t_2 = 0.0625 * (z * t); tmp = 0.0; if (z <= -3.8e+214) tmp = t_2; elseif (z <= -9e-294) tmp = t_1; elseif (z <= 3.6e-271) tmp = b * (a * -0.25); elseif (z <= 2.45e-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[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+214], t$95$2, If[LessEqual[z, -9e-294], t$95$1, If[LessEqual[z, 3.6e-271], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-79], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+214}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-294}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-271}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.79999999999999997e214 or 2.45e-79 < z Initial program 95.1%
Taylor expanded in z around inf 97.1%
Taylor expanded in a around 0 77.2%
Taylor expanded in z around inf 46.7%
if -3.79999999999999997e214 < z < -8.99999999999999963e-294 or 3.5999999999999998e-271 < z < 2.45e-79Initial program 100.0%
Taylor expanded in a around 0 79.7%
Taylor expanded in t around 0 62.1%
if -8.99999999999999963e-294 < z < 3.5999999999999998e-271Initial program 100.0%
Taylor expanded in x around 0 89.5%
Taylor expanded in a around inf 78.8%
associate-*r*78.8%
*-commutative78.8%
Simplified78.8%
Final simplification56.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* a b) -2e+191) (not (<= (* a b) 1e+86)))
(- t_1 (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -2e+191) || !((a * b) <= 1e+86)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((a * b) <= (-2d+191)) .or. (.not. ((a * b) <= 1d+86))) then
tmp = t_1 - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -2e+191) || !((a * b) <= 1e+86)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((a * b) <= -2e+191) or not ((a * b) <= 1e+86): tmp = t_1 - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -2e+191) || !(Float64(a * b) <= 1e+86)) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((a * b) <= -2e+191) || ~(((a * b) <= 1e+86))) tmp = t_1 - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+191], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+86]], $MachinePrecision]], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+191} \lor \neg \left(a \cdot b \leq 10^{+86}\right):\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000015e191 or 1e86 < (*.f64 a b) Initial program 97.5%
Taylor expanded in x around 0 85.7%
Taylor expanded in c around 0 82.0%
if -2.00000000000000015e191 < (*.f64 a b) < 1e86Initial program 98.3%
Taylor expanded in a around 0 91.9%
Final simplification88.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+64) (not (<= (* a b) 4e+78))) (- (+ 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+64) || !((a * b) <= 4e+78)) {
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+64)) .or. (.not. ((a * b) <= 4d+78))) 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+64) || !((a * b) <= 4e+78)) {
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+64) or not ((a * b) <= 4e+78): 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+64) || !(Float64(a * b) <= 4e+78)) 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+64) || ~(((a * b) <= 4e+78))) 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+64], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4e+78]], $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^{+64} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+78}\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.00000000000000004e64 or 4.00000000000000003e78 < (*.f64 a b) Initial program 96.9%
Taylor expanded in z around 0 83.2%
if -2.00000000000000004e64 < (*.f64 a b) < 4.00000000000000003e78Initial program 98.7%
Taylor expanded in a around 0 93.6%
Final simplification89.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -270000000000.0) (not (<= (* x y) 1.95e+176))) (+ 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) <= -270000000000.0) || !((x * y) <= 1.95e+176)) {
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) <= (-270000000000.0d0)) .or. (.not. ((x * y) <= 1.95d+176))) 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) <= -270000000000.0) || !((x * y) <= 1.95e+176)) {
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) <= -270000000000.0) or not ((x * y) <= 1.95e+176): 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) <= -270000000000.0) || !(Float64(x * y) <= 1.95e+176)) 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) <= -270000000000.0) || ~(((x * y) <= 1.95e+176))) 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], -270000000000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.95e+176]], $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 -270000000000 \lor \neg \left(x \cdot y \leq 1.95 \cdot 10^{+176}\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.7e11 or 1.9500000000000001e176 < (*.f64 x y) Initial program 95.9%
Taylor expanded in a around 0 83.3%
Taylor expanded in t around 0 77.6%
if -2.7e11 < (*.f64 x y) < 1.9500000000000001e176Initial program 99.3%
Taylor expanded in a around 0 71.3%
Taylor expanded in x around 0 66.0%
associate-*r*66.0%
*-commutative66.0%
Simplified66.0%
Final simplification70.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= b -1.45e+82)
t_1
(if (<= b 3.2e+205) (+ c (+ (* x y) (* 0.0625 (* z t)))) (+ c 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 <= -1.45e+82) {
tmp = t_1;
} else if (b <= 3.2e+205) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + 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 <= (-1.45d+82)) then
tmp = t_1
else if (b <= 3.2d+205) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + 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 <= -1.45e+82) {
tmp = t_1;
} else if (b <= 3.2e+205) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) tmp = 0 if b <= -1.45e+82: tmp = t_1 elif b <= 3.2e+205: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (b <= -1.45e+82) tmp = t_1; elseif (b <= 3.2e+205) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + 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 <= -1.45e+82) tmp = t_1; elseif (b <= 3.2e+205) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + t_1; 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]}, If[LessEqual[b, -1.45e+82], t$95$1, If[LessEqual[b, 3.2e+205], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{+205}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + t\_1\\
\end{array}
\end{array}
if b < -1.4500000000000001e82Initial program 100.0%
Taylor expanded in x around 0 84.7%
Taylor expanded in a around inf 49.7%
associate-*r*49.7%
*-commutative49.7%
Simplified49.7%
if -1.4500000000000001e82 < b < 3.19999999999999996e205Initial program 98.4%
Taylor expanded in a around 0 82.8%
if 3.19999999999999996e205 < b Initial program 90.0%
Taylor expanded in a around inf 66.4%
associate-*r*66.4%
*-commutative66.4%
*-commutative66.4%
Simplified66.4%
Final simplification75.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3.95e-25) (not (<= (* x y) 7.1e+74))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -3.95e-25) || !((x * y) <= 7.1e+74)) {
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) <= (-3.95d-25)) .or. (.not. ((x * y) <= 7.1d+74))) 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) <= -3.95e-25) || !((x * y) <= 7.1e+74)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -3.95e-25) or not ((x * y) <= 7.1e+74): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -3.95e-25) || !(Float64(x * y) <= 7.1e+74)) 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) <= -3.95e-25) || ~(((x * y) <= 7.1e+74))) 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], -3.95e-25], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.1e+74]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.95 \cdot 10^{-25} \lor \neg \left(x \cdot y \leq 7.1 \cdot 10^{+74}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -3.9499999999999998e-25 or 7.10000000000000002e74 < (*.f64 x y) Initial program 96.6%
Taylor expanded in z around inf 86.3%
Taylor expanded in a around 0 78.3%
Taylor expanded in x around inf 60.2%
if -3.9499999999999998e-25 < (*.f64 x y) < 7.10000000000000002e74Initial program 99.3%
Taylor expanded in c around inf 32.1%
Final simplification45.1%
(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 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 22.6%
Final simplification22.6%
herbie shell --seed 2024130
(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))