
(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 100.0%
associate--l+100.0%
fma-define100.0%
associate-/l*100.0%
fma-neg100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
(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 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-+l-100.0%
fma-define100.0%
*-commutative100.0%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25))))
(t_2 (+ c (* t (* z 0.0625))))
(t_3 (+ c (* x y))))
(if (<= (* x y) -1e+178)
t_3
(if (<= (* x y) -1e-65)
t_1
(if (<= (* x y) -5e-324)
t_2
(if (<= (* x y) 2e-215) t_1 (if (<= (* x y) 5e+29) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (t * (z * 0.0625));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1e+178) {
tmp = t_3;
} else if ((x * y) <= -1e-65) {
tmp = t_1;
} else if ((x * y) <= -5e-324) {
tmp = t_2;
} else if ((x * y) <= 2e-215) {
tmp = t_1;
} else if ((x * y) <= 5e+29) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (t * (z * 0.0625d0))
t_3 = c + (x * y)
if ((x * y) <= (-1d+178)) then
tmp = t_3
else if ((x * y) <= (-1d-65)) then
tmp = t_1
else if ((x * y) <= (-5d-324)) then
tmp = t_2
else if ((x * y) <= 2d-215) then
tmp = t_1
else if ((x * y) <= 5d+29) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (t * (z * 0.0625));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1e+178) {
tmp = t_3;
} else if ((x * y) <= -1e-65) {
tmp = t_1;
} else if ((x * y) <= -5e-324) {
tmp = t_2;
} else if ((x * y) <= 2e-215) {
tmp = t_1;
} else if ((x * y) <= 5e+29) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (t * (z * 0.0625)) t_3 = c + (x * y) tmp = 0 if (x * y) <= -1e+178: tmp = t_3 elif (x * y) <= -1e-65: tmp = t_1 elif (x * y) <= -5e-324: tmp = t_2 elif (x * y) <= 2e-215: tmp = t_1 elif (x * y) <= 5e+29: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(t * Float64(z * 0.0625))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+178) tmp = t_3; elseif (Float64(x * y) <= -1e-65) tmp = t_1; elseif (Float64(x * y) <= -5e-324) tmp = t_2; elseif (Float64(x * y) <= 2e-215) tmp = t_1; elseif (Float64(x * y) <= 5e+29) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = c + (t * (z * 0.0625)); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+178) tmp = t_3; elseif ((x * y) <= -1e-65) tmp = t_1; elseif ((x * y) <= -5e-324) tmp = t_2; elseif ((x * y) <= 2e-215) tmp = t_1; elseif ((x * y) <= 5e+29) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+178], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1e-65], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-324], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-215], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+29], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+178}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-324}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0000000000000001e178 or 5.0000000000000001e29 < (*.f64 x y) Initial program 99.9%
Taylor expanded in x around inf 75.7%
if -1.0000000000000001e178 < (*.f64 x y) < -9.99999999999999923e-66 or -4.94066e-324 < (*.f64 x y) < 2.00000000000000008e-215Initial program 99.9%
Taylor expanded in a around inf 73.0%
*-commutative73.0%
associate-*r*73.0%
Simplified73.0%
if -9.99999999999999923e-66 < (*.f64 x y) < -4.94066e-324 or 2.00000000000000008e-215 < (*.f64 x y) < 5.0000000000000001e29Initial program 100.0%
Taylor expanded in z around inf 74.3%
associate-*r*74.3%
*-commutative74.3%
associate-*r*74.3%
Simplified74.3%
Final simplification74.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))))
(if (<= (* x y) -1e+57)
(- (* x y) (* (* a b) 0.25))
(if (<= (* x y) -1e-65)
t_1
(if (<= (* x y) -5e-324)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 1e-13) t_1 (* t (+ (* z 0.0625) (/ (* x y) t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -1e+57) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= -1e-65) {
tmp = t_1;
} else if ((x * y) <= -5e-324) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 1e-13) {
tmp = t_1;
} else {
tmp = t * ((z * 0.0625) + ((x * y) / 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) :: t_1
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
if ((x * y) <= (-1d+57)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((x * y) <= (-1d-65)) then
tmp = t_1
else if ((x * y) <= (-5d-324)) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 1d-13) then
tmp = t_1
else
tmp = t * ((z * 0.0625d0) + ((x * y) / 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 t_1 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -1e+57) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= -1e-65) {
tmp = t_1;
} else if ((x * y) <= -5e-324) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 1e-13) {
tmp = t_1;
} else {
tmp = t * ((z * 0.0625) + ((x * y) / t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) tmp = 0 if (x * y) <= -1e+57: tmp = (x * y) - ((a * b) * 0.25) elif (x * y) <= -1e-65: tmp = t_1 elif (x * y) <= -5e-324: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 1e-13: tmp = t_1 else: tmp = t * ((z * 0.0625) + ((x * y) / t)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(x * y) <= -1e+57) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(x * y) <= -1e-65) tmp = t_1; elseif (Float64(x * y) <= -5e-324) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 1e-13) tmp = t_1; else tmp = Float64(t * Float64(Float64(z * 0.0625) + Float64(Float64(x * y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); tmp = 0.0; if ((x * y) <= -1e+57) tmp = (x * y) - ((a * b) * 0.25); elseif ((x * y) <= -1e-65) tmp = t_1; elseif ((x * y) <= -5e-324) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 1e-13) tmp = t_1; else tmp = t * ((z * 0.0625) + ((x * y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+57], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-65], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-324], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-13], t$95$1, N[(t * N[(N[(z * 0.0625), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+57}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625 + \frac{x \cdot y}{t}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000005e57Initial program 99.9%
Taylor expanded in z around 0 88.0%
Taylor expanded in c around 0 77.0%
if -1.00000000000000005e57 < (*.f64 x y) < -9.99999999999999923e-66 or -4.94066e-324 < (*.f64 x y) < 1e-13Initial program 99.9%
Taylor expanded in a around inf 74.6%
*-commutative74.6%
associate-*r*74.6%
Simplified74.6%
if -9.99999999999999923e-66 < (*.f64 x y) < -4.94066e-324Initial program 100.0%
Taylor expanded in z around inf 73.8%
associate-*r*73.8%
*-commutative73.8%
associate-*r*73.8%
Simplified73.8%
if 1e-13 < (*.f64 x y) Initial program 100.0%
Taylor expanded in t around inf 91.1%
Taylor expanded in a around 0 84.3%
Taylor expanded in c around 0 78.3%
Final simplification76.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* a b) -4e+99) (not (<= (* a b) 1e+56)))
(- (+ c 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) <= -4e+99) || !((a * b) <= 1e+56)) {
tmp = (c + 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) <= (-4d+99)) .or. (.not. ((a * b) <= 1d+56))) then
tmp = (c + 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) <= -4e+99) || !((a * b) <= 1e+56)) {
tmp = (c + 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) <= -4e+99) or not ((a * b) <= 1e+56): tmp = (c + 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) <= -4e+99) || !(Float64(a * b) <= 1e+56)) tmp = Float64(Float64(c + 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) <= -4e+99) || ~(((a * b) <= 1e+56))) tmp = (c + 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], -4e+99], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+56]], $MachinePrecision]], N[(N[(c + t$95$1), $MachinePrecision] - 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 -4 \cdot 10^{+99} \lor \neg \left(a \cdot b \leq 10^{+56}\right):\\
\;\;\;\;\left(c + t\_1\right) - \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) < -3.9999999999999999e99 or 1.00000000000000009e56 < (*.f64 a b) Initial program 99.9%
Taylor expanded in x around 0 90.2%
if -3.9999999999999999e99 < (*.f64 a b) < 1.00000000000000009e56Initial program 100.0%
Taylor expanded in a around 0 96.9%
Final simplification94.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -1.05e+174)
t_1
(if (<= (* x y) 1.6e-6)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 3.2e+29) (* t (* z 0.0625)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1.05e+174) {
tmp = t_1;
} else if ((x * y) <= 1.6e-6) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 3.2e+29) {
tmp = t * (z * 0.0625);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-1.05d+174)) then
tmp = t_1
else if ((x * y) <= 1.6d-6) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 3.2d+29) then
tmp = t * (z * 0.0625d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1.05e+174) {
tmp = t_1;
} else if ((x * y) <= 1.6e-6) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 3.2e+29) {
tmp = t * (z * 0.0625);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -1.05e+174: tmp = t_1 elif (x * y) <= 1.6e-6: tmp = c + (a * (b * -0.25)) elif (x * y) <= 3.2e+29: tmp = t * (z * 0.0625) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.05e+174) tmp = t_1; elseif (Float64(x * y) <= 1.6e-6) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 3.2e+29) tmp = Float64(t * Float64(z * 0.0625)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.05e+174) tmp = t_1; elseif ((x * y) <= 1.6e-6) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 3.2e+29) tmp = t * (z * 0.0625); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+174], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.6e-6], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+29], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{-6}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+29}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.05000000000000008e174 or 3.19999999999999987e29 < (*.f64 x y) Initial program 99.9%
Taylor expanded in x around inf 75.7%
if -1.05000000000000008e174 < (*.f64 x y) < 1.5999999999999999e-6Initial program 100.0%
Taylor expanded in a around inf 67.2%
*-commutative67.2%
associate-*r*67.2%
Simplified67.2%
if 1.5999999999999999e-6 < (*.f64 x y) < 3.19999999999999987e29Initial program 100.0%
Taylor expanded in z around inf 81.3%
associate-*r*81.3%
*-commutative81.3%
associate-*r*81.3%
Simplified81.3%
Taylor expanded in t around inf 81.3%
associate-*r*81.3%
*-commutative81.3%
associate-*r*81.3%
Simplified81.3%
Final simplification70.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+22) (not (<= (* a b) 1e+70))) (- (+ 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+22) || !((a * b) <= 1e+70)) {
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+22)) .or. (.not. ((a * b) <= 1d+70))) 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+22) || !((a * b) <= 1e+70)) {
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+22) or not ((a * b) <= 1e+70): 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+22) || !(Float64(a * b) <= 1e+70)) 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+22) || ~(((a * b) <= 1e+70))) 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+22], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+70]], $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^{+22} \lor \neg \left(a \cdot b \leq 10^{+70}\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) < -2e22 or 1.00000000000000007e70 < (*.f64 a b) Initial program 100.0%
Taylor expanded in z around 0 86.0%
if -2e22 < (*.f64 a b) < 1.00000000000000007e70Initial program 100.0%
Taylor expanded in a around 0 97.4%
Final simplification92.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -4e+99)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 2e+192)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -4e+99) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 2e+192) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-4d+99)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 2d+192) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -4e+99) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 2e+192) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -4e+99: tmp = c + (a * (b * -0.25)) elif (a * b) <= 2e+192: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -4e+99) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 2e+192) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -4e+99) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 2e+192) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -4e+99], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+192], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+99}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+192}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -3.9999999999999999e99Initial program 99.9%
Taylor expanded in a around inf 78.7%
*-commutative78.7%
associate-*r*78.7%
Simplified78.7%
if -3.9999999999999999e99 < (*.f64 a b) < 2.00000000000000008e192Initial program 100.0%
Taylor expanded in a around 0 93.0%
if 2.00000000000000008e192 < (*.f64 a b) Initial program 100.0%
Taylor expanded in z around 0 90.6%
Taylor expanded in c around 0 87.4%
Final simplification89.9%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* a b) -1e+91) (+ c (* a (* b -0.25))) (if (<= (* a b) 1e+54) (+ c (* x y)) (- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+91) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 1e+54) {
tmp = c + (x * y);
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-1d+91)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 1d+54) then
tmp = c + (x * y)
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+91) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 1e+54) {
tmp = c + (x * y);
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+91: tmp = c + (a * (b * -0.25)) elif (a * b) <= 1e+54: tmp = c + (x * y) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+91) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 1e+54) tmp = Float64(c + Float64(x * y)); else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -1e+91) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 1e+54) tmp = c + (x * y); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+91], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+54], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+91}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+54}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000008e91Initial program 99.9%
Taylor expanded in a around inf 75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
if -1.00000000000000008e91 < (*.f64 a b) < 1.0000000000000001e54Initial program 100.0%
Taylor expanded in x around inf 68.6%
if 1.0000000000000001e54 < (*.f64 a b) Initial program 100.0%
Taylor expanded in z around 0 83.1%
Taylor expanded in c around 0 77.3%
Final simplification71.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= b -1.9e-24)
t_1
(if (<= b 4.6e-153) (* t (* z 0.0625)) (if (<= b 2.7e+96) 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.9e-24) {
tmp = t_1;
} else if (b <= 4.6e-153) {
tmp = t * (z * 0.0625);
} else if (b <= 2.7e+96) {
tmp = c;
} 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 <= (-1.9d-24)) then
tmp = t_1
else if (b <= 4.6d-153) then
tmp = t * (z * 0.0625d0)
else if (b <= 2.7d+96) then
tmp = c
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 <= -1.9e-24) {
tmp = t_1;
} else if (b <= 4.6e-153) {
tmp = t * (z * 0.0625);
} else if (b <= 2.7e+96) {
tmp = c;
} 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 <= -1.9e-24: tmp = t_1 elif b <= 4.6e-153: tmp = t * (z * 0.0625) elif b <= 2.7e+96: tmp = c else: tmp = 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.9e-24) tmp = t_1; elseif (b <= 4.6e-153) tmp = Float64(t * Float64(z * 0.0625)); elseif (b <= 2.7e+96) tmp = c; 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 <= -1.9e-24) tmp = t_1; elseif (b <= 4.6e-153) tmp = t * (z * 0.0625); elseif (b <= 2.7e+96) tmp = c; else tmp = 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.9e-24], t$95$1, If[LessEqual[b, 4.6e-153], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.7e+96], c, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{-153}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{+96}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.90000000000000013e-24 or 2.70000000000000022e96 < b Initial program 99.9%
Taylor expanded in z around 0 83.4%
Taylor expanded in a around inf 51.4%
associate-*r*51.4%
*-commutative51.4%
*-commutative51.4%
Simplified51.4%
if -1.90000000000000013e-24 < b < 4.59999999999999994e-153Initial program 100.0%
Taylor expanded in z around inf 58.4%
associate-*r*58.4%
*-commutative58.4%
associate-*r*58.4%
Simplified58.4%
Taylor expanded in t around inf 32.3%
associate-*r*32.3%
*-commutative32.3%
associate-*r*32.3%
Simplified32.3%
if 4.59999999999999994e-153 < b < 2.70000000000000022e96Initial program 100.0%
Taylor expanded in c around inf 27.1%
Final simplification38.7%
(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 100.0%
Final simplification100.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -2.8e-17) (not (<= b 3.6e+178))) (* 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 ((b <= -2.8e-17) || !(b <= 3.6e+178)) {
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 ((b <= (-2.8d-17)) .or. (.not. (b <= 3.6d+178))) 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 ((b <= -2.8e-17) || !(b <= 3.6e+178)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -2.8e-17) or not (b <= 3.6e+178): 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 ((b <= -2.8e-17) || !(b <= 3.6e+178)) 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 ((b <= -2.8e-17) || ~((b <= 3.6e+178))) 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[b, -2.8e-17], N[Not[LessEqual[b, 3.6e+178]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{-17} \lor \neg \left(b \leq 3.6 \cdot 10^{+178}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if b < -2.7999999999999999e-17 or 3.5999999999999998e178 < b Initial program 99.9%
Taylor expanded in z around 0 82.5%
Taylor expanded in a around inf 54.6%
associate-*r*54.6%
*-commutative54.6%
*-commutative54.6%
Simplified54.6%
if -2.7999999999999999e-17 < b < 3.5999999999999998e178Initial program 100.0%
Taylor expanded in x around inf 60.3%
Final simplification58.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -3.5e-26) (not (<= b 4.5e+96))) (* b (* a -0.25)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -3.5e-26) || !(b <= 4.5e+96)) {
tmp = b * (a * -0.25);
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((b <= (-3.5d-26)) .or. (.not. (b <= 4.5d+96))) then
tmp = b * (a * (-0.25d0))
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -3.5e-26) || !(b <= 4.5e+96)) {
tmp = b * (a * -0.25);
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -3.5e-26) or not (b <= 4.5e+96): tmp = b * (a * -0.25) else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -3.5e-26) || !(b <= 4.5e+96)) tmp = Float64(b * Float64(a * -0.25)); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -3.5e-26) || ~((b <= 4.5e+96))) tmp = b * (a * -0.25); else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -3.5e-26], N[Not[LessEqual[b, 4.5e+96]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{-26} \lor \neg \left(b \leq 4.5 \cdot 10^{+96}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if b < -3.49999999999999985e-26 or 4.49999999999999957e96 < b Initial program 99.9%
Taylor expanded in z around 0 83.4%
Taylor expanded in a around inf 51.4%
associate-*r*51.4%
*-commutative51.4%
*-commutative51.4%
Simplified51.4%
if -3.49999999999999985e-26 < b < 4.49999999999999957e96Initial program 100.0%
Taylor expanded in c around inf 28.2%
Final simplification37.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 100.0%
Taylor expanded in c around inf 22.9%
herbie shell --seed 2024119
(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))