
(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 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma x y (+ c (* (* a b) -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma(x, y, (c + ((a * b) * -0.25)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = fma(x, y, Float64(c + Float64(Float64(a * b) * -0.25))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(x * y + N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c + \left(a \cdot b\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
associate-+l-0.0%
associate--l+0.0%
fma-def33.3%
associate-*l/33.3%
fma-neg44.4%
sub-neg44.4%
distribute-neg-in44.4%
remove-double-neg44.4%
associate-/l*44.4%
distribute-frac-neg44.4%
associate-/r/44.4%
fma-def44.4%
neg-mul-144.4%
*-commutative44.4%
associate-/l*44.4%
metadata-eval44.4%
Simplified44.4%
Taylor expanded in z around 0 55.6%
Final simplification98.4%
(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 96.5%
associate-+l-96.5%
associate--l+96.5%
fma-def97.7%
associate-*l/97.7%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*98.0%
distribute-frac-neg98.0%
associate-/r/98.0%
fma-def98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*98.0%
metadata-eval98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma y x (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma(y, x, (a * (b * -0.25)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = fma(y, x, Float64(a * Float64(b * -0.25))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, a \cdot \left(b \cdot -0.25\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
associate-+l-0.0%
fma-def0.0%
*-commutative0.0%
associate-/l*0.0%
associate-/l*0.0%
Simplified0.0%
Taylor expanded in t around 0 22.2%
Taylor expanded in c around 0 22.2%
fma-neg55.6%
distribute-lft-neg-in55.6%
metadata-eval55.6%
*-commutative55.6%
associate-*l*55.6%
Simplified55.6%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = a * (b * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(a * Float64(b * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = a * (b * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
associate-+l-0.0%
fma-def0.0%
*-commutative0.0%
associate-/l*0.0%
associate-/l*0.0%
Simplified0.0%
Taylor expanded in x around 0 33.3%
Taylor expanded in a around inf 44.6%
*-commutative44.6%
associate-*l*44.6%
Simplified44.6%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625))))
(t_2 (+ c (* (* a b) -0.25)))
(t_3 (+ c (* x y))))
(if (<= (* a b) -2e+56)
t_2
(if (<= (* a b) -5e-12)
t_1
(if (<= (* a b) -5e-112)
t_3
(if (<= (* a b) 0.0)
t_1
(if (<= (* a b) 1e-99) t_3 (if (<= (* a b) 1e+107) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + ((a * b) * -0.25);
double t_3 = c + (x * y);
double tmp;
if ((a * b) <= -2e+56) {
tmp = t_2;
} else if ((a * b) <= -5e-12) {
tmp = t_1;
} else if ((a * b) <= -5e-112) {
tmp = t_3;
} else if ((a * b) <= 0.0) {
tmp = t_1;
} else if ((a * b) <= 1e-99) {
tmp = t_3;
} else if ((a * b) <= 1e+107) {
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) :: t_3
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = c + ((a * b) * (-0.25d0))
t_3 = c + (x * y)
if ((a * b) <= (-2d+56)) then
tmp = t_2
else if ((a * b) <= (-5d-12)) then
tmp = t_1
else if ((a * b) <= (-5d-112)) then
tmp = t_3
else if ((a * b) <= 0.0d0) then
tmp = t_1
else if ((a * b) <= 1d-99) then
tmp = t_3
else if ((a * b) <= 1d+107) 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 + (t * (z * 0.0625));
double t_2 = c + ((a * b) * -0.25);
double t_3 = c + (x * y);
double tmp;
if ((a * b) <= -2e+56) {
tmp = t_2;
} else if ((a * b) <= -5e-12) {
tmp = t_1;
} else if ((a * b) <= -5e-112) {
tmp = t_3;
} else if ((a * b) <= 0.0) {
tmp = t_1;
} else if ((a * b) <= 1e-99) {
tmp = t_3;
} else if ((a * b) <= 1e+107) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + ((a * b) * -0.25) t_3 = c + (x * y) tmp = 0 if (a * b) <= -2e+56: tmp = t_2 elif (a * b) <= -5e-12: tmp = t_1 elif (a * b) <= -5e-112: tmp = t_3 elif (a * b) <= 0.0: tmp = t_1 elif (a * b) <= 1e-99: tmp = t_3 elif (a * b) <= 1e+107: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(Float64(a * b) * -0.25)) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -2e+56) tmp = t_2; elseif (Float64(a * b) <= -5e-12) tmp = t_1; elseif (Float64(a * b) <= -5e-112) tmp = t_3; elseif (Float64(a * b) <= 0.0) tmp = t_1; elseif (Float64(a * b) <= 1e-99) tmp = t_3; elseif (Float64(a * b) <= 1e+107) 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 + (t * (z * 0.0625)); t_2 = c + ((a * b) * -0.25); t_3 = c + (x * y); tmp = 0.0; if ((a * b) <= -2e+56) tmp = t_2; elseif ((a * b) <= -5e-12) tmp = t_1; elseif ((a * b) <= -5e-112) tmp = t_3; elseif ((a * b) <= 0.0) tmp = t_1; elseif ((a * b) <= 1e-99) tmp = t_3; elseif ((a * b) <= 1e+107) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+56], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -5e-12], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5e-112], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-99], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 1e+107], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + \left(a \cdot b\right) \cdot -0.25\\
t_3 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+56}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-112}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-99}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000018e56 or 9.9999999999999997e106 < (*.f64 a b) Initial program 91.4%
Taylor expanded in a around inf 72.8%
*-commutative72.8%
Simplified72.8%
if -2.00000000000000018e56 < (*.f64 a b) < -4.9999999999999997e-12 or -5.00000000000000044e-112 < (*.f64 a b) < 0.0 or 1e-99 < (*.f64 a b) < 9.9999999999999997e106Initial program 100.0%
Taylor expanded in z around inf 74.4%
associate-*r*74.4%
*-commutative74.4%
associate-*r*74.4%
Simplified74.4%
if -4.9999999999999997e-12 < (*.f64 a b) < -5.00000000000000044e-112 or 0.0 < (*.f64 a b) < 1e-99Initial program 97.6%
Taylor expanded in x around inf 84.2%
Final simplification75.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (* a (* b -0.25))))
(if (<= y -2.7e-51)
(* x y)
(if (<= y -1.5e-295)
t_1
(if (<= y 2.2e-245)
t_2
(if (<= y 4.2e-205)
t_1
(if (<= y 3.8e-102)
c
(if (<= y 2.6e-83)
t_1
(if (<= y 2e+14) c (if (<= y 1e+138) t_2 (* 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 t_2 = a * (b * -0.25);
double tmp;
if (y <= -2.7e-51) {
tmp = x * y;
} else if (y <= -1.5e-295) {
tmp = t_1;
} else if (y <= 2.2e-245) {
tmp = t_2;
} else if (y <= 4.2e-205) {
tmp = t_1;
} else if (y <= 3.8e-102) {
tmp = c;
} else if (y <= 2.6e-83) {
tmp = t_1;
} else if (y <= 2e+14) {
tmp = c;
} else if (y <= 1e+138) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = a * (b * (-0.25d0))
if (y <= (-2.7d-51)) then
tmp = x * y
else if (y <= (-1.5d-295)) then
tmp = t_1
else if (y <= 2.2d-245) then
tmp = t_2
else if (y <= 4.2d-205) then
tmp = t_1
else if (y <= 3.8d-102) then
tmp = c
else if (y <= 2.6d-83) then
tmp = t_1
else if (y <= 2d+14) then
tmp = c
else if (y <= 1d+138) then
tmp = t_2
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 t_2 = a * (b * -0.25);
double tmp;
if (y <= -2.7e-51) {
tmp = x * y;
} else if (y <= -1.5e-295) {
tmp = t_1;
} else if (y <= 2.2e-245) {
tmp = t_2;
} else if (y <= 4.2e-205) {
tmp = t_1;
} else if (y <= 3.8e-102) {
tmp = c;
} else if (y <= 2.6e-83) {
tmp = t_1;
} else if (y <= 2e+14) {
tmp = c;
} else if (y <= 1e+138) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = a * (b * -0.25) tmp = 0 if y <= -2.7e-51: tmp = x * y elif y <= -1.5e-295: tmp = t_1 elif y <= 2.2e-245: tmp = t_2 elif y <= 4.2e-205: tmp = t_1 elif y <= 3.8e-102: tmp = c elif y <= 2.6e-83: tmp = t_1 elif y <= 2e+14: tmp = c elif y <= 1e+138: tmp = t_2 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (y <= -2.7e-51) tmp = Float64(x * y); elseif (y <= -1.5e-295) tmp = t_1; elseif (y <= 2.2e-245) tmp = t_2; elseif (y <= 4.2e-205) tmp = t_1; elseif (y <= 3.8e-102) tmp = c; elseif (y <= 2.6e-83) tmp = t_1; elseif (y <= 2e+14) tmp = c; elseif (y <= 1e+138) tmp = t_2; 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); t_2 = a * (b * -0.25); tmp = 0.0; if (y <= -2.7e-51) tmp = x * y; elseif (y <= -1.5e-295) tmp = t_1; elseif (y <= 2.2e-245) tmp = t_2; elseif (y <= 4.2e-205) tmp = t_1; elseif (y <= 3.8e-102) tmp = c; elseif (y <= 2.6e-83) tmp = t_1; elseif (y <= 2e+14) tmp = c; elseif (y <= 1e+138) tmp = t_2; 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]}, Block[{t$95$2 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-51], N[(x * y), $MachinePrecision], If[LessEqual[y, -1.5e-295], t$95$1, If[LessEqual[y, 2.2e-245], t$95$2, If[LessEqual[y, 4.2e-205], t$95$1, If[LessEqual[y, 3.8e-102], c, If[LessEqual[y, 2.6e-83], t$95$1, If[LessEqual[y, 2e+14], c, If[LessEqual[y, 1e+138], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-51}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-245}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-102}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+14}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 10^{+138}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.6999999999999997e-51 or 1e138 < y Initial program 92.2%
Taylor expanded in x around inf 59.0%
Taylor expanded in y around inf 44.1%
if -2.6999999999999997e-51 < y < -1.49999999999999998e-295 or 2.19999999999999993e-245 < y < 4.19999999999999965e-205 or 3.80000000000000026e-102 < y < 2.60000000000000009e-83Initial program 98.7%
associate-+l-98.7%
fma-def98.7%
*-commutative98.7%
associate-/l*98.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in x around 0 94.0%
Taylor expanded in t around inf 38.6%
if -1.49999999999999998e-295 < y < 2.19999999999999993e-245 or 2e14 < y < 1e138Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 79.0%
Taylor expanded in a around inf 36.4%
*-commutative36.4%
associate-*l*36.4%
Simplified36.4%
if 4.19999999999999965e-205 < y < 3.80000000000000026e-102 or 2.60000000000000009e-83 < y < 2e14Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in c around inf 47.8%
Final simplification41.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* 0.0625 (* z t)) (* (* a b) 0.25))))
(if (<= c -2.5e+36)
(+ c (* t (* z 0.0625)))
(if (<= c 1.95e-172)
t_1
(if (<= c 8.5e-143) (* x y) (if (<= c 1.55e+45) t_1 (+ c (* 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)) - ((a * b) * 0.25);
double tmp;
if (c <= -2.5e+36) {
tmp = c + (t * (z * 0.0625));
} else if (c <= 1.95e-172) {
tmp = t_1;
} else if (c <= 8.5e-143) {
tmp = x * y;
} else if (c <= 1.55e+45) {
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 = (0.0625d0 * (z * t)) - ((a * b) * 0.25d0)
if (c <= (-2.5d+36)) then
tmp = c + (t * (z * 0.0625d0))
else if (c <= 1.95d-172) then
tmp = t_1
else if (c <= 8.5d-143) then
tmp = x * y
else if (c <= 1.55d+45) 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 = (0.0625 * (z * t)) - ((a * b) * 0.25);
double tmp;
if (c <= -2.5e+36) {
tmp = c + (t * (z * 0.0625));
} else if (c <= 1.95e-172) {
tmp = t_1;
} else if (c <= 8.5e-143) {
tmp = x * y;
} else if (c <= 1.55e+45) {
tmp = t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (0.0625 * (z * t)) - ((a * b) * 0.25) tmp = 0 if c <= -2.5e+36: tmp = c + (t * (z * 0.0625)) elif c <= 1.95e-172: tmp = t_1 elif c <= 8.5e-143: tmp = x * y elif c <= 1.55e+45: tmp = t_1 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(0.0625 * Float64(z * t)) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (c <= -2.5e+36) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (c <= 1.95e-172) tmp = t_1; elseif (c <= 8.5e-143) tmp = Float64(x * y); elseif (c <= 1.55e+45) 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 = (0.0625 * (z * t)) - ((a * b) * 0.25); tmp = 0.0; if (c <= -2.5e+36) tmp = c + (t * (z * 0.0625)); elseif (c <= 1.95e-172) tmp = t_1; elseif (c <= 8.5e-143) tmp = x * y; elseif (c <= 1.55e+45) 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[(N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.5e+36], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.95e-172], t$95$1, If[LessEqual[c, 8.5e-143], N[(x * y), $MachinePrecision], If[LessEqual[c, 1.55e+45], t$95$1, N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;c \leq -2.5 \cdot 10^{+36}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{-172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{-143}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \leq 1.55 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if c < -2.49999999999999988e36Initial program 95.2%
Taylor expanded in z around inf 74.5%
associate-*r*74.5%
*-commutative74.5%
associate-*r*74.5%
Simplified74.5%
if -2.49999999999999988e36 < c < 1.94999999999999986e-172 or 8.50000000000000072e-143 < c < 1.54999999999999994e45Initial program 97.7%
associate-+l-97.7%
fma-def97.7%
*-commutative97.7%
associate-/l*97.6%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in x around 0 76.8%
Taylor expanded in c around 0 73.9%
if 1.94999999999999986e-172 < c < 8.50000000000000072e-143Initial program 87.5%
Taylor expanded in x around inf 87.6%
Taylor expanded in y around inf 87.6%
if 1.54999999999999994e45 < c Initial program 96.4%
Taylor expanded in x around inf 71.4%
Final simplification73.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (or (<= z -1.25e-66) (not (<= z 3.2e-116)))
(- (+ c (* 0.0625 (* z t))) t_1)
(- (+ c (* x y)) 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 ((z <= -1.25e-66) || !(z <= 3.2e-116)) {
tmp = (c + (0.0625 * (z * t))) - t_1;
} 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 = (a * b) * 0.25d0
if ((z <= (-1.25d-66)) .or. (.not. (z <= 3.2d-116))) then
tmp = (c + (0.0625d0 * (z * t))) - t_1
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 = (a * b) * 0.25;
double tmp;
if ((z <= -1.25e-66) || !(z <= 3.2e-116)) {
tmp = (c + (0.0625 * (z * t))) - t_1;
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if (z <= -1.25e-66) or not (z <= 3.2e-116): tmp = (c + (0.0625 * (z * t))) - t_1 else: tmp = (c + (x * y)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if ((z <= -1.25e-66) || !(z <= 3.2e-116)) tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - t_1); else tmp = Float64(Float64(c + Float64(x * y)) - 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 ((z <= -1.25e-66) || ~((z <= 3.2e-116))) tmp = (c + (0.0625 * (z * t))) - t_1; 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[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[Or[LessEqual[z, -1.25e-66], N[Not[LessEqual[z, 3.2e-116]], $MachinePrecision]], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-66} \lor \neg \left(z \leq 3.2 \cdot 10^{-116}\right):\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\end{array}
\end{array}
if z < -1.2499999999999999e-66 or 3.20000000000000009e-116 < z Initial program 96.4%
associate-+l-96.4%
fma-def96.4%
*-commutative96.4%
associate-/l*96.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in x around 0 82.3%
if -1.2499999999999999e-66 < z < 3.20000000000000009e-116Initial program 96.6%
associate-+l-96.6%
fma-def96.6%
*-commutative96.6%
associate-/l*96.6%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in t around 0 90.1%
Final simplification85.0%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= y -1.1e-51)
(and (not (<= y 1.26e+116))
(or (<= y 5.8e+149) (not (<= y 2.25e+203)))))
(+ c (* x y))
(+ c (* t (* z 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((y <= -1.1e-51) || (!(y <= 1.26e+116) && ((y <= 5.8e+149) || !(y <= 2.25e+203)))) {
tmp = c + (x * y);
} else {
tmp = c + (t * (z * 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 ((y <= (-1.1d-51)) .or. (.not. (y <= 1.26d+116)) .and. (y <= 5.8d+149) .or. (.not. (y <= 2.25d+203))) then
tmp = c + (x * y)
else
tmp = c + (t * (z * 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 ((y <= -1.1e-51) || (!(y <= 1.26e+116) && ((y <= 5.8e+149) || !(y <= 2.25e+203)))) {
tmp = c + (x * y);
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (y <= -1.1e-51) or (not (y <= 1.26e+116) and ((y <= 5.8e+149) or not (y <= 2.25e+203))): tmp = c + (x * y) else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((y <= -1.1e-51) || (!(y <= 1.26e+116) && ((y <= 5.8e+149) || !(y <= 2.25e+203)))) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((y <= -1.1e-51) || (~((y <= 1.26e+116)) && ((y <= 5.8e+149) || ~((y <= 2.25e+203))))) tmp = c + (x * y); else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[y, -1.1e-51], And[N[Not[LessEqual[y, 1.26e+116]], $MachinePrecision], Or[LessEqual[y, 5.8e+149], N[Not[LessEqual[y, 2.25e+203]], $MachinePrecision]]]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-51} \lor \neg \left(y \leq 1.26 \cdot 10^{+116}\right) \land \left(y \leq 5.8 \cdot 10^{+149} \lor \neg \left(y \leq 2.25 \cdot 10^{+203}\right)\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if y < -1.1e-51 or 1.2599999999999999e116 < y < 5.8000000000000004e149 or 2.2500000000000001e203 < y Initial program 92.6%
Taylor expanded in x around inf 60.8%
if -1.1e-51 < y < 1.2599999999999999e116 or 5.8000000000000004e149 < y < 2.2500000000000001e203Initial program 98.8%
Taylor expanded in z around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
associate-*r*63.3%
Simplified63.3%
Final simplification62.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (<= t -6.7e-50)
(- (* 0.0625 (* z t)) t_1)
(if (<= t 2.65e+135) (- (+ c (* x y)) t_1) (+ c (* t (* z 0.0625)))))))
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 (t <= -6.7e-50) {
tmp = (0.0625 * (z * t)) - t_1;
} else if (t <= 2.65e+135) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = c + (t * (z * 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) :: t_1
real(8) :: tmp
t_1 = (a * b) * 0.25d0
if (t <= (-6.7d-50)) then
tmp = (0.0625d0 * (z * t)) - t_1
else if (t <= 2.65d+135) then
tmp = (c + (x * y)) - t_1
else
tmp = c + (t * (z * 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 t_1 = (a * b) * 0.25;
double tmp;
if (t <= -6.7e-50) {
tmp = (0.0625 * (z * t)) - t_1;
} else if (t <= 2.65e+135) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if t <= -6.7e-50: tmp = (0.0625 * (z * t)) - t_1 elif t <= 2.65e+135: tmp = (c + (x * y)) - t_1 else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (t <= -6.7e-50) tmp = Float64(Float64(0.0625 * Float64(z * t)) - t_1); elseif (t <= 2.65e+135) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); 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 (t <= -6.7e-50) tmp = (0.0625 * (z * t)) - t_1; elseif (t <= 2.65e+135) tmp = (c + (x * y)) - t_1; else tmp = c + (t * (z * 0.0625)); 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]}, If[LessEqual[t, -6.7e-50], N[(N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 2.65e+135], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;t \leq -6.7 \cdot 10^{-50}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right) - t_1\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{+135}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if t < -6.7000000000000005e-50Initial program 94.4%
associate-+l-94.4%
fma-def94.4%
*-commutative94.4%
associate-/l*94.3%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in x around 0 82.5%
Taylor expanded in c around 0 66.4%
if -6.7000000000000005e-50 < t < 2.65000000000000008e135Initial program 97.1%
associate-+l-97.1%
fma-def97.1%
*-commutative97.1%
associate-/l*97.1%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in t around 0 90.3%
if 2.65000000000000008e135 < t Initial program 100.0%
Taylor expanded in z around inf 83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*r*83.0%
Simplified83.0%
Final simplification81.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= y -3.9e-53)
(* x y)
(if (<= y 3.9e-203)
t_1
(if (<= y 1.4e-103)
c
(if (<= y 8e-83) t_1 (if (<= y 3.2e+74) c (* 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 (y <= -3.9e-53) {
tmp = x * y;
} else if (y <= 3.9e-203) {
tmp = t_1;
} else if (y <= 1.4e-103) {
tmp = c;
} else if (y <= 8e-83) {
tmp = t_1;
} else if (y <= 3.2e+74) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (y <= (-3.9d-53)) then
tmp = x * y
else if (y <= 3.9d-203) then
tmp = t_1
else if (y <= 1.4d-103) then
tmp = c
else if (y <= 8d-83) then
tmp = t_1
else if (y <= 3.2d+74) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (y <= -3.9e-53) {
tmp = x * y;
} else if (y <= 3.9e-203) {
tmp = t_1;
} else if (y <= 1.4e-103) {
tmp = c;
} else if (y <= 8e-83) {
tmp = t_1;
} else if (y <= 3.2e+74) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if y <= -3.9e-53: tmp = x * y elif y <= 3.9e-203: tmp = t_1 elif y <= 1.4e-103: tmp = c elif y <= 8e-83: tmp = t_1 elif y <= 3.2e+74: tmp = c 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 (y <= -3.9e-53) tmp = Float64(x * y); elseif (y <= 3.9e-203) tmp = t_1; elseif (y <= 1.4e-103) tmp = c; elseif (y <= 8e-83) tmp = t_1; elseif (y <= 3.2e+74) tmp = c; 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 (y <= -3.9e-53) tmp = x * y; elseif (y <= 3.9e-203) tmp = t_1; elseif (y <= 1.4e-103) tmp = c; elseif (y <= 8e-83) tmp = t_1; elseif (y <= 3.2e+74) tmp = c; 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[y, -3.9e-53], N[(x * y), $MachinePrecision], If[LessEqual[y, 3.9e-203], t$95$1, If[LessEqual[y, 1.4e-103], c, If[LessEqual[y, 8e-83], t$95$1, If[LessEqual[y, 3.2e+74], c, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{-53}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-103}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+74}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -3.9000000000000002e-53 or 3.19999999999999995e74 < y Initial program 93.2%
Taylor expanded in x around inf 56.9%
Taylor expanded in y around inf 42.2%
if -3.9000000000000002e-53 < y < 3.8999999999999999e-203 or 1.40000000000000011e-103 < y < 8.0000000000000003e-83Initial program 98.9%
associate-+l-98.9%
fma-def98.9%
*-commutative98.9%
associate-/l*98.8%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in x around 0 93.7%
Taylor expanded in t around inf 35.2%
if 3.8999999999999999e-203 < y < 1.40000000000000011e-103 or 8.0000000000000003e-83 < y < 3.19999999999999995e74Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in c around inf 41.5%
Final simplification39.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= b -9.2e+49)
t_1
(if (<= b 3.8e+153)
(+ c (* x y))
(if (or (<= b 3.8e+236) (not (<= b 1.4e+252)))
t_1
(* 0.0625 (* z t)))))))
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 <= -9.2e+49) {
tmp = t_1;
} else if (b <= 3.8e+153) {
tmp = c + (x * y);
} else if ((b <= 3.8e+236) || !(b <= 1.4e+252)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
if (b <= (-9.2d+49)) then
tmp = t_1
else if (b <= 3.8d+153) then
tmp = c + (x * y)
else if ((b <= 3.8d+236) .or. (.not. (b <= 1.4d+252))) then
tmp = t_1
else
tmp = 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 t_1 = a * (b * -0.25);
double tmp;
if (b <= -9.2e+49) {
tmp = t_1;
} else if (b <= 3.8e+153) {
tmp = c + (x * y);
} else if ((b <= 3.8e+236) || !(b <= 1.4e+252)) {
tmp = t_1;
} else {
tmp = 0.0625 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if b <= -9.2e+49: tmp = t_1 elif b <= 3.8e+153: tmp = c + (x * y) elif (b <= 3.8e+236) or not (b <= 1.4e+252): tmp = t_1 else: tmp = 0.0625 * (z * t) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (b <= -9.2e+49) tmp = t_1; elseif (b <= 3.8e+153) tmp = Float64(c + Float64(x * y)); elseif ((b <= 3.8e+236) || !(b <= 1.4e+252)) tmp = t_1; else tmp = Float64(0.0625 * Float64(z * t)); 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 <= -9.2e+49) tmp = t_1; elseif (b <= 3.8e+153) tmp = c + (x * y); elseif ((b <= 3.8e+236) || ~((b <= 1.4e+252))) tmp = t_1; else tmp = 0.0625 * (z * t); 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, -9.2e+49], t$95$1, If[LessEqual[b, 3.8e+153], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 3.8e+236], N[Not[LessEqual[b, 1.4e+252]], $MachinePrecision]], t$95$1, N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+153}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+236} \lor \neg \left(b \leq 1.4 \cdot 10^{+252}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if b < -9.20000000000000008e49 or 3.79999999999999966e153 < b < 3.79999999999999986e236 or 1.40000000000000002e252 < b Initial program 91.6%
associate-+l-91.6%
fma-def91.6%
*-commutative91.6%
associate-/l*91.5%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in x around 0 86.0%
Taylor expanded in a around inf 52.5%
*-commutative52.5%
associate-*l*52.5%
Simplified52.5%
if -9.20000000000000008e49 < b < 3.79999999999999966e153Initial program 98.8%
Taylor expanded in x around inf 59.0%
if 3.79999999999999986e236 < b < 1.40000000000000002e252Initial program 99.6%
associate-+l-99.6%
fma-def99.6%
*-commutative99.6%
associate-/l*99.6%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 75.2%
Taylor expanded in t around inf 76.1%
Final simplification57.1%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -6e-90) (* x y) (if (<= y 1.45e+74) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -6e-90) {
tmp = x * y;
} else if (y <= 1.45e+74) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (y <= (-6d-90)) then
tmp = x * y
else if (y <= 1.45d+74) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -6e-90) {
tmp = x * y;
} else if (y <= 1.45e+74) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -6e-90: tmp = x * y elif y <= 1.45e+74: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -6e-90) tmp = Float64(x * y); elseif (y <= 1.45e+74) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -6e-90) tmp = x * y; elseif (y <= 1.45e+74) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -6e-90], N[(x * y), $MachinePrecision], If[LessEqual[y, 1.45e+74], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-90}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+74}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -6.00000000000000041e-90 or 1.4500000000000001e74 < y Initial program 93.7%
Taylor expanded in x around inf 54.3%
Taylor expanded in y around inf 39.1%
if -6.00000000000000041e-90 < y < 1.4500000000000001e74Initial program 99.2%
associate-+l-99.2%
fma-def99.2%
*-commutative99.2%
associate-/l*99.2%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in c around inf 36.3%
Final simplification37.7%
(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 96.5%
associate-+l-96.5%
fma-def96.5%
*-commutative96.5%
associate-/l*96.4%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in c around inf 26.6%
Final simplification26.6%
herbie shell --seed 2023274
(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))