
(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 x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
fma-def99.2%
associate-*l/99.2%
fma-neg99.6%
sub-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
associate-/l*99.5%
distribute-frac-neg99.5%
associate-/r/99.6%
fma-def99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -4.6e+236)
(* x y)
(if (or (<= (* x y) -9e+138)
(and (not (<= (* x y) -3.2e-80))
(or (<= (* x y) 7.2e-53)
(and (not (<= (* x y) 3.4e+127)) (<= (* x y) 1.95e+164)))))
(+ c (* a (* b -0.25)))
(+ (* x y) (* (* 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) <= -4.6e+236) {
tmp = x * y;
} else if (((x * y) <= -9e+138) || (!((x * y) <= -3.2e-80) && (((x * y) <= 7.2e-53) || (!((x * y) <= 3.4e+127) && ((x * y) <= 1.95e+164))))) {
tmp = c + (a * (b * -0.25));
} else {
tmp = (x * y) + ((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) <= (-4.6d+236)) then
tmp = x * y
else if (((x * y) <= (-9d+138)) .or. (.not. ((x * y) <= (-3.2d-80))) .and. ((x * y) <= 7.2d-53) .or. (.not. ((x * y) <= 3.4d+127)) .and. ((x * y) <= 1.95d+164)) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = (x * y) + ((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) <= -4.6e+236) {
tmp = x * y;
} else if (((x * y) <= -9e+138) || (!((x * y) <= -3.2e-80) && (((x * y) <= 7.2e-53) || (!((x * y) <= 3.4e+127) && ((x * y) <= 1.95e+164))))) {
tmp = c + (a * (b * -0.25));
} else {
tmp = (x * y) + ((z * t) * 0.0625);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -4.6e+236: tmp = x * y elif ((x * y) <= -9e+138) or (not ((x * y) <= -3.2e-80) and (((x * y) <= 7.2e-53) or (not ((x * y) <= 3.4e+127) and ((x * y) <= 1.95e+164)))): tmp = c + (a * (b * -0.25)) else: tmp = (x * y) + ((z * t) * 0.0625) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -4.6e+236) tmp = Float64(x * y); elseif ((Float64(x * y) <= -9e+138) || (!(Float64(x * y) <= -3.2e-80) && ((Float64(x * y) <= 7.2e-53) || (!(Float64(x * y) <= 3.4e+127) && (Float64(x * y) <= 1.95e+164))))) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -4.6e+236) tmp = x * y; elseif (((x * y) <= -9e+138) || (~(((x * y) <= -3.2e-80)) && (((x * y) <= 7.2e-53) || (~(((x * y) <= 3.4e+127)) && ((x * y) <= 1.95e+164))))) tmp = c + (a * (b * -0.25)); else tmp = (x * y) + ((z * t) * 0.0625); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.6e+236], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -9e+138], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -3.2e-80]], $MachinePrecision], Or[LessEqual[N[(x * y), $MachinePrecision], 7.2e-53], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.4e+127]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 1.95e+164]]]]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+236}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{+138} \lor \neg \left(x \cdot y \leq -3.2 \cdot 10^{-80}\right) \land \left(x \cdot y \leq 7.2 \cdot 10^{-53} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+127}\right) \land x \cdot y \leq 1.95 \cdot 10^{+164}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\end{array}
\end{array}
if (*.f64 x y) < -4.5999999999999999e236Initial program 94.1%
Taylor expanded in a around 0 94.1%
Taylor expanded in c around 0 94.1%
Taylor expanded in t around 0 100.0%
if -4.5999999999999999e236 < (*.f64 x y) < -8.99999999999999963e138 or -3.1999999999999999e-80 < (*.f64 x y) < 7.1999999999999998e-53 or 3.39999999999999977e127 < (*.f64 x y) < 1.94999999999999993e164Initial program 99.3%
Taylor expanded in a around inf 77.4%
*-commutative77.4%
associate-*r*77.4%
Simplified77.4%
if -8.99999999999999963e138 < (*.f64 x y) < -3.1999999999999999e-80 or 7.1999999999999998e-53 < (*.f64 x y) < 3.39999999999999977e127 or 1.94999999999999993e164 < (*.f64 x y) Initial program 100.0%
Taylor expanded in a around 0 83.2%
Taylor expanded in c around 0 70.0%
Final simplification76.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))) (t_2 (+ c (* t (* z 0.0625)))))
(if (<= (* x y) -4.6e+236)
(* x y)
(if (<= (* x y) -1.6e+147)
t_1
(if (<= (* x y) -3.4e-212)
t_2
(if (<= (* x y) -8.5e-301)
t_1
(if (<= (* x y) 9.5e+33) t_2 (+ c (* x y)))))))))
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 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -4.6e+236) {
tmp = x * y;
} else if ((x * y) <= -1.6e+147) {
tmp = t_1;
} else if ((x * y) <= -3.4e-212) {
tmp = t_2;
} else if ((x * y) <= -8.5e-301) {
tmp = t_1;
} else if ((x * y) <= 9.5e+33) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
t_2 = c + (t * (z * 0.0625d0))
if ((x * y) <= (-4.6d+236)) then
tmp = x * y
else if ((x * y) <= (-1.6d+147)) then
tmp = t_1
else if ((x * y) <= (-3.4d-212)) then
tmp = t_2
else if ((x * y) <= (-8.5d-301)) then
tmp = t_1
else if ((x * y) <= 9.5d+33) then
tmp = t_2
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 t_1 = a * (b * -0.25);
double t_2 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -4.6e+236) {
tmp = x * y;
} else if ((x * y) <= -1.6e+147) {
tmp = t_1;
} else if ((x * y) <= -3.4e-212) {
tmp = t_2;
} else if ((x * y) <= -8.5e-301) {
tmp = t_1;
} else if ((x * y) <= 9.5e+33) {
tmp = t_2;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) t_2 = c + (t * (z * 0.0625)) tmp = 0 if (x * y) <= -4.6e+236: tmp = x * y elif (x * y) <= -1.6e+147: tmp = t_1 elif (x * y) <= -3.4e-212: tmp = t_2 elif (x * y) <= -8.5e-301: tmp = t_1 elif (x * y) <= 9.5e+33: tmp = t_2 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) t_2 = Float64(c + Float64(t * Float64(z * 0.0625))) tmp = 0.0 if (Float64(x * y) <= -4.6e+236) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.6e+147) tmp = t_1; elseif (Float64(x * y) <= -3.4e-212) tmp = t_2; elseif (Float64(x * y) <= -8.5e-301) tmp = t_1; elseif (Float64(x * y) <= 9.5e+33) tmp = t_2; else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); t_2 = c + (t * (z * 0.0625)); tmp = 0.0; if ((x * y) <= -4.6e+236) tmp = x * y; elseif ((x * y) <= -1.6e+147) tmp = t_1; elseif ((x * y) <= -3.4e-212) tmp = t_2; elseif ((x * y) <= -8.5e-301) tmp = t_1; elseif ((x * y) <= 9.5e+33) tmp = t_2; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.6e+236], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.6e+147], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e-212], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e-301], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 9.5e+33], t$95$2, N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+236}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.6 \cdot 10^{+147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-212}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.5999999999999999e236Initial program 94.1%
Taylor expanded in a around 0 94.1%
Taylor expanded in c around 0 94.1%
Taylor expanded in t around 0 100.0%
if -4.5999999999999999e236 < (*.f64 x y) < -1.59999999999999989e147 or -3.39999999999999998e-212 < (*.f64 x y) < -8.50000000000000046e-301Initial program 99.9%
Taylor expanded in a around inf 80.0%
*-commutative80.0%
associate-*r*80.0%
Simplified80.0%
Taylor expanded in a around inf 66.2%
*-commutative66.2%
associate-*r*66.2%
*-commutative66.2%
Simplified66.2%
if -1.59999999999999989e147 < (*.f64 x y) < -3.39999999999999998e-212 or -8.50000000000000046e-301 < (*.f64 x y) < 9.5000000000000003e33Initial program 99.4%
Taylor expanded in a around 0 69.8%
Taylor expanded in t around inf 63.9%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.9%
Simplified63.9%
if 9.5000000000000003e33 < (*.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 84.9%
Taylor expanded in t around 0 64.3%
+-commutative64.3%
Simplified64.3%
Final simplification66.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))))
(if (<= (* x y) -2.7e+243)
(* x y)
(if (<= (* x y) -3.5e+142)
t_1
(if (<= (* x y) -1.7e-168)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 5e+29) t_1 (+ c (* x y))))))))
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) <= -2.7e+243) {
tmp = x * y;
} else if ((x * y) <= -3.5e+142) {
tmp = t_1;
} else if ((x * y) <= -1.7e-168) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 5e+29) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
if ((x * y) <= (-2.7d+243)) then
tmp = x * y
else if ((x * y) <= (-3.5d+142)) then
tmp = t_1
else if ((x * y) <= (-1.7d-168)) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 5d+29) then
tmp = t_1
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 t_1 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -2.7e+243) {
tmp = x * y;
} else if ((x * y) <= -3.5e+142) {
tmp = t_1;
} else if ((x * y) <= -1.7e-168) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 5e+29) {
tmp = t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) tmp = 0 if (x * y) <= -2.7e+243: tmp = x * y elif (x * y) <= -3.5e+142: tmp = t_1 elif (x * y) <= -1.7e-168: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 5e+29: tmp = t_1 else: tmp = c + (x * y) 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) <= -2.7e+243) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.5e+142) tmp = t_1; elseif (Float64(x * y) <= -1.7e-168) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 5e+29) tmp = t_1; else tmp = Float64(c + Float64(x * y)); 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) <= -2.7e+243) tmp = x * y; elseif ((x * y) <= -3.5e+142) tmp = t_1; elseif ((x * y) <= -1.7e-168) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 5e+29) tmp = t_1; else tmp = c + (x * y); 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], -2.7e+243], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e+142], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-168], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+29], t$95$1, N[(c + N[(x * y), $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 -2.7 \cdot 10^{+243}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-168}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.7000000000000001e243Initial program 94.1%
Taylor expanded in a around 0 94.1%
Taylor expanded in c around 0 94.1%
Taylor expanded in t around 0 100.0%
if -2.7000000000000001e243 < (*.f64 x y) < -3.49999999999999997e142 or -1.70000000000000011e-168 < (*.f64 x y) < 5.0000000000000001e29Initial program 99.3%
Taylor expanded in a around inf 74.4%
*-commutative74.4%
associate-*r*74.4%
Simplified74.4%
if -3.49999999999999997e142 < (*.f64 x y) < -1.70000000000000011e-168Initial program 100.0%
Taylor expanded in a around 0 76.9%
Taylor expanded in t around inf 62.8%
associate-*r*62.8%
*-commutative62.8%
associate-*l*62.8%
Simplified62.8%
if 5.0000000000000001e29 < (*.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 84.9%
Taylor expanded in t around 0 64.3%
+-commutative64.3%
Simplified64.3%
Final simplification71.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+188) (not (<= (* a b) 5e-81))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+188) || !((a * b) <= 5e-81)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + ((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 (((a * b) <= (-5d+188)) .or. (.not. ((a * b) <= 5d-81))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + ((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 (((a * b) <= -5e+188) || !((a * b) <= 5e-81)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+188) or not ((a * b) <= 5e-81): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+188) || !(Float64(a * b) <= 5e-81)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+188) || ~(((a * b) <= 5e-81))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+188], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e-81]], $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[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+188} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{-81}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000001e188 or 4.99999999999999981e-81 < (*.f64 a b) Initial program 98.2%
Taylor expanded in z around 0 89.5%
if -5.0000000000000001e188 < (*.f64 a b) < 4.99999999999999981e-81Initial program 100.0%
Taylor expanded in a around 0 95.7%
Final simplification92.9%
(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 99.2%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= b -5e-65)
t_1
(if (<= b -2.3e-297)
(* x y)
(if (<= b 1.1e-52)
c
(if (<= b 2.05e+21) (* x y) (if (<= b 3.6e+101) c t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if (b <= -5e-65) {
tmp = t_1;
} else if (b <= -2.3e-297) {
tmp = x * y;
} else if (b <= 1.1e-52) {
tmp = c;
} else if (b <= 2.05e+21) {
tmp = x * y;
} else if (b <= 3.6e+101) {
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 = a * (b * (-0.25d0))
if (b <= (-5d-65)) then
tmp = t_1
else if (b <= (-2.3d-297)) then
tmp = x * y
else if (b <= 1.1d-52) then
tmp = c
else if (b <= 2.05d+21) then
tmp = x * y
else if (b <= 3.6d+101) 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 = a * (b * -0.25);
double tmp;
if (b <= -5e-65) {
tmp = t_1;
} else if (b <= -2.3e-297) {
tmp = x * y;
} else if (b <= 1.1e-52) {
tmp = c;
} else if (b <= 2.05e+21) {
tmp = x * y;
} else if (b <= 3.6e+101) {
tmp = c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if b <= -5e-65: tmp = t_1 elif b <= -2.3e-297: tmp = x * y elif b <= 1.1e-52: tmp = c elif b <= 2.05e+21: tmp = x * y elif b <= 3.6e+101: tmp = c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (b <= -5e-65) tmp = t_1; elseif (b <= -2.3e-297) tmp = Float64(x * y); elseif (b <= 1.1e-52) tmp = c; elseif (b <= 2.05e+21) tmp = Float64(x * y); elseif (b <= 3.6e+101) tmp = c; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); tmp = 0.0; if (b <= -5e-65) tmp = t_1; elseif (b <= -2.3e-297) tmp = x * y; elseif (b <= 1.1e-52) tmp = c; elseif (b <= 2.05e+21) tmp = x * y; elseif (b <= 3.6e+101) tmp = c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5e-65], t$95$1, If[LessEqual[b, -2.3e-297], N[(x * y), $MachinePrecision], If[LessEqual[b, 1.1e-52], c, If[LessEqual[b, 2.05e+21], N[(x * y), $MachinePrecision], If[LessEqual[b, 3.6e+101], c, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -5 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.3 \cdot 10^{-297}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{-52}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 2.05 \cdot 10^{+21}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{+101}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -4.99999999999999983e-65 or 3.60000000000000029e101 < b Initial program 98.3%
Taylor expanded in a around inf 68.9%
*-commutative68.9%
associate-*r*68.9%
Simplified68.9%
Taylor expanded in a around inf 52.4%
*-commutative52.4%
associate-*r*52.4%
*-commutative52.4%
Simplified52.4%
if -4.99999999999999983e-65 < b < -2.2999999999999999e-297 or 1.10000000000000005e-52 < b < 2.05e21Initial program 100.0%
Taylor expanded in a around 0 86.0%
Taylor expanded in c around 0 62.6%
Taylor expanded in t around 0 34.2%
if -2.2999999999999999e-297 < b < 1.10000000000000005e-52 or 2.05e21 < b < 3.60000000000000029e101Initial program 100.0%
Taylor expanded in c around inf 39.3%
Final simplification44.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -8.4e-50) (not (<= b 8.5e+165))) (+ c (* a (* b -0.25))) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -8.4e-50) || !(b <= 8.5e+165)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + ((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 ((b <= (-8.4d-50)) .or. (.not. (b <= 8.5d+165))) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = c + ((x * y) + ((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 ((b <= -8.4e-50) || !(b <= 8.5e+165)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -8.4e-50) or not (b <= 8.5e+165): tmp = c + (a * (b * -0.25)) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -8.4e-50) || !(b <= 8.5e+165)) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -8.4e-50) || ~((b <= 8.5e+165))) tmp = c + (a * (b * -0.25)); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -8.4e-50], N[Not[LessEqual[b, 8.5e+165]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.4 \cdot 10^{-50} \lor \neg \left(b \leq 8.5 \cdot 10^{+165}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if b < -8.4000000000000003e-50 or 8.5000000000000001e165 < b Initial program 98.1%
Taylor expanded in a around inf 70.2%
*-commutative70.2%
associate-*r*70.2%
Simplified70.2%
if -8.4000000000000003e-50 < b < 8.5000000000000001e165Initial program 100.0%
Taylor expanded in a around 0 86.0%
Final simplification79.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= b -5.5e-65)
t_1
(if (<= b -1.3e-296)
(* x y)
(if (<= b 5.5e-15) c (if (<= b 3.1e+41) (* 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 = a * (b * -0.25);
double tmp;
if (b <= -5.5e-65) {
tmp = t_1;
} else if (b <= -1.3e-296) {
tmp = x * y;
} else if (b <= 5.5e-15) {
tmp = c;
} else if (b <= 3.1e+41) {
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 = a * (b * (-0.25d0))
if (b <= (-5.5d-65)) then
tmp = t_1
else if (b <= (-1.3d-296)) then
tmp = x * y
else if (b <= 5.5d-15) then
tmp = c
else if (b <= 3.1d+41) 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 = a * (b * -0.25);
double tmp;
if (b <= -5.5e-65) {
tmp = t_1;
} else if (b <= -1.3e-296) {
tmp = x * y;
} else if (b <= 5.5e-15) {
tmp = c;
} else if (b <= 3.1e+41) {
tmp = t * (z * 0.0625);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if b <= -5.5e-65: tmp = t_1 elif b <= -1.3e-296: tmp = x * y elif b <= 5.5e-15: tmp = c elif b <= 3.1e+41: tmp = t * (z * 0.0625) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (b <= -5.5e-65) tmp = t_1; elseif (b <= -1.3e-296) tmp = Float64(x * y); elseif (b <= 5.5e-15) tmp = c; elseif (b <= 3.1e+41) 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 = a * (b * -0.25); tmp = 0.0; if (b <= -5.5e-65) tmp = t_1; elseif (b <= -1.3e-296) tmp = x * y; elseif (b <= 5.5e-15) tmp = c; elseif (b <= 3.1e+41) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.5e-65], t$95$1, If[LessEqual[b, -1.3e-296], N[(x * y), $MachinePrecision], If[LessEqual[b, 5.5e-15], c, If[LessEqual[b, 3.1e+41], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -5.5 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.3 \cdot 10^{-296}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-15}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{+41}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -5.4999999999999999e-65 or 3.1e41 < b Initial program 98.5%
Taylor expanded in a around inf 69.0%
*-commutative69.0%
associate-*r*69.0%
Simplified69.0%
Taylor expanded in a around inf 49.0%
*-commutative49.0%
associate-*r*49.0%
*-commutative49.0%
Simplified49.0%
if -5.4999999999999999e-65 < b < -1.3e-296Initial program 100.0%
Taylor expanded in a around 0 91.6%
Taylor expanded in c around 0 59.3%
Taylor expanded in t around 0 35.6%
if -1.3e-296 < b < 5.5000000000000002e-15Initial program 100.0%
Taylor expanded in c around inf 35.0%
if 5.5000000000000002e-15 < b < 3.1e41Initial program 99.9%
Taylor expanded in a around 0 73.8%
Taylor expanded in t around inf 54.7%
associate-*r*54.7%
*-commutative54.7%
associate-*l*54.7%
Simplified54.7%
Taylor expanded in c around 0 52.2%
associate-*r*52.2%
*-commutative52.2%
associate-*r*52.2%
Simplified52.2%
Final simplification43.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.5e-79) (not (<= (* x y) 1.15e+42))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.5e-79) || !((x * y) <= 1.15e+42)) {
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) <= (-1.5d-79)) .or. (.not. ((x * y) <= 1.15d+42))) 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) <= -1.5e-79) || !((x * y) <= 1.15e+42)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.5e-79) or not ((x * y) <= 1.15e+42): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.5e-79) || !(Float64(x * y) <= 1.15e+42)) 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) <= -1.5e-79) || ~(((x * y) <= 1.15e+42))) 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], -1.5e-79], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.15e+42]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{-79} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+42}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.5e-79 or 1.15e42 < (*.f64 x y) Initial program 99.1%
Taylor expanded in a around 0 77.9%
Taylor expanded in c around 0 68.0%
Taylor expanded in t around 0 47.9%
if -1.5e-79 < (*.f64 x y) < 1.15e42Initial program 99.3%
Taylor expanded in c around inf 39.2%
Final simplification43.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -2e+82) (not (<= a 4e-52))) (* a (* b -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -2e+82) || !(a <= 4e-52)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a <= (-2d+82)) .or. (.not. (a <= 4d-52))) then
tmp = a * (b * (-0.25d0))
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -2e+82) || !(a <= 4e-52)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -2e+82) or not (a <= 4e-52): tmp = a * (b * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -2e+82) || !(a <= 4e-52)) tmp = Float64(a * Float64(b * -0.25)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a <= -2e+82) || ~((a <= 4e-52))) tmp = a * (b * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -2e+82], N[Not[LessEqual[a, 4e-52]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+82} \lor \neg \left(a \leq 4 \cdot 10^{-52}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.9999999999999999e82 or 4e-52 < a Initial program 99.1%
Taylor expanded in a around inf 70.7%
*-commutative70.7%
associate-*r*70.7%
Simplified70.7%
Taylor expanded in a around inf 55.9%
*-commutative55.9%
associate-*r*55.9%
*-commutative55.9%
Simplified55.9%
if -1.9999999999999999e82 < a < 4e-52Initial program 99.3%
Taylor expanded in a around 0 90.4%
Taylor expanded in t around 0 62.6%
+-commutative62.6%
Simplified62.6%
Final simplification59.6%
(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 99.2%
Taylor expanded in c around inf 26.3%
Final simplification26.3%
herbie shell --seed 2023318
(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))