
(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 13 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 97.7%
associate-+l-97.7%
associate--l+97.7%
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 (+ (fma x y (/ t (/ 16.0 z))) (- c (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (t / (16.0 / z))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(t / Float64(16.0 / z))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(t / N[(16.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 97.7%
associate-+l-97.7%
fma-def98.8%
*-commutative98.8%
associate-/l*98.8%
associate-/l*98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
(if (<= t_1 INFINITY)
(+ c t_1)
(- (+ c (* (* z t) 0.0625)) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - ((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 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = (c + ((z * t) * 0.0625)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(Float64(c + Float64(Float64(z * t) * 0.0625)) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = (c + ((z * t) * 0.0625)) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + \left(z \cdot t\right) \cdot 0.0625\right) - \left(a \cdot b\right) \cdot 0.25\\
\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-def50.0%
*-commutative50.0%
associate-/l*50.0%
associate-/l*50.0%
Simplified50.0%
Taylor expanded in x around 0 66.7%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* (* z t) 0.0625)))
(t_2 (+ c (* a (* b -0.25))))
(t_3 (+ c (* x y))))
(if (<= (* a b) -2e+78)
t_2
(if (<= (* a b) -4e-79)
t_1
(if (<= (* a b) -2e-201)
t_3
(if (<= (* a b) 1e-192)
t_1
(if (<= (* a b) 2e-123) t_3 (if (<= (* a b) 10.0) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((z * t) * 0.0625);
double t_2 = c + (a * (b * -0.25));
double t_3 = c + (x * y);
double tmp;
if ((a * b) <= -2e+78) {
tmp = t_2;
} else if ((a * b) <= -4e-79) {
tmp = t_1;
} else if ((a * b) <= -2e-201) {
tmp = t_3;
} else if ((a * b) <= 1e-192) {
tmp = t_1;
} else if ((a * b) <= 2e-123) {
tmp = t_3;
} else if ((a * b) <= 10.0) {
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 + ((z * t) * 0.0625d0)
t_2 = c + (a * (b * (-0.25d0)))
t_3 = c + (x * y)
if ((a * b) <= (-2d+78)) then
tmp = t_2
else if ((a * b) <= (-4d-79)) then
tmp = t_1
else if ((a * b) <= (-2d-201)) then
tmp = t_3
else if ((a * b) <= 1d-192) then
tmp = t_1
else if ((a * b) <= 2d-123) then
tmp = t_3
else if ((a * b) <= 10.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((z * t) * 0.0625);
double t_2 = c + (a * (b * -0.25));
double t_3 = c + (x * y);
double tmp;
if ((a * b) <= -2e+78) {
tmp = t_2;
} else if ((a * b) <= -4e-79) {
tmp = t_1;
} else if ((a * b) <= -2e-201) {
tmp = t_3;
} else if ((a * b) <= 1e-192) {
tmp = t_1;
} else if ((a * b) <= 2e-123) {
tmp = t_3;
} else if ((a * b) <= 10.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + ((z * t) * 0.0625) t_2 = c + (a * (b * -0.25)) t_3 = c + (x * y) tmp = 0 if (a * b) <= -2e+78: tmp = t_2 elif (a * b) <= -4e-79: tmp = t_1 elif (a * b) <= -2e-201: tmp = t_3 elif (a * b) <= 1e-192: tmp = t_1 elif (a * b) <= 2e-123: tmp = t_3 elif (a * b) <= 10.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(Float64(z * t) * 0.0625)) t_2 = Float64(c + Float64(a * Float64(b * -0.25))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -2e+78) tmp = t_2; elseif (Float64(a * b) <= -4e-79) tmp = t_1; elseif (Float64(a * b) <= -2e-201) tmp = t_3; elseif (Float64(a * b) <= 1e-192) tmp = t_1; elseif (Float64(a * b) <= 2e-123) tmp = t_3; elseif (Float64(a * b) <= 10.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + ((z * t) * 0.0625); t_2 = c + (a * (b * -0.25)); t_3 = c + (x * y); tmp = 0.0; if ((a * b) <= -2e+78) tmp = t_2; elseif ((a * b) <= -4e-79) tmp = t_1; elseif ((a * b) <= -2e-201) tmp = t_3; elseif ((a * b) <= 1e-192) tmp = t_1; elseif ((a * b) <= 2e-123) tmp = t_3; elseif ((a * b) <= 10.0) 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[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+78], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -4e-79], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2e-201], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 1e-192], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e-123], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 10.0], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + \left(z \cdot t\right) \cdot 0.0625\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+78}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-201}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-123}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 10:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000002e78 or 10 < (*.f64 a b) Initial program 97.0%
Taylor expanded in a around inf 71.9%
*-commutative71.9%
associate-*l*71.9%
Simplified71.9%
if -2.00000000000000002e78 < (*.f64 a b) < -4e-79 or -1.99999999999999989e-201 < (*.f64 a b) < 1.0000000000000001e-192 or 2.0000000000000001e-123 < (*.f64 a b) < 10Initial program 97.5%
associate-+l-97.5%
fma-def100.0%
*-commutative100.0%
associate-/l*99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 88.6%
Taylor expanded in t around inf 70.1%
if -4e-79 < (*.f64 a b) < -1.99999999999999989e-201 or 1.0000000000000001e-192 < (*.f64 a b) < 2.0000000000000001e-123Initial 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 t around 0 87.0%
Taylor expanded in a around 0 84.4%
Final simplification72.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625))
(t_2 (* (* a b) 0.25))
(t_3 (- (+ c (* x y)) t_2))
(t_4 (+ c (+ (* x y) t_1))))
(if (<= (* x y) -3.4e+128)
t_4
(if (<= (* x y) -4.5e+66)
t_3
(if (<= (* x y) -0.0053)
t_4
(if (<= (* x y) 1.65e+75) (- (+ c t_1) t_2) t_3))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double t_2 = (a * b) * 0.25;
double t_3 = (c + (x * y)) - t_2;
double t_4 = c + ((x * y) + t_1);
double tmp;
if ((x * y) <= -3.4e+128) {
tmp = t_4;
} else if ((x * y) <= -4.5e+66) {
tmp = t_3;
} else if ((x * y) <= -0.0053) {
tmp = t_4;
} else if ((x * y) <= 1.65e+75) {
tmp = (c + t_1) - 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) :: t_4
real(8) :: tmp
t_1 = (z * t) * 0.0625d0
t_2 = (a * b) * 0.25d0
t_3 = (c + (x * y)) - t_2
t_4 = c + ((x * y) + t_1)
if ((x * y) <= (-3.4d+128)) then
tmp = t_4
else if ((x * y) <= (-4.5d+66)) then
tmp = t_3
else if ((x * y) <= (-0.0053d0)) then
tmp = t_4
else if ((x * y) <= 1.65d+75) then
tmp = (c + t_1) - 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 = (z * t) * 0.0625;
double t_2 = (a * b) * 0.25;
double t_3 = (c + (x * y)) - t_2;
double t_4 = c + ((x * y) + t_1);
double tmp;
if ((x * y) <= -3.4e+128) {
tmp = t_4;
} else if ((x * y) <= -4.5e+66) {
tmp = t_3;
} else if ((x * y) <= -0.0053) {
tmp = t_4;
} else if ((x * y) <= 1.65e+75) {
tmp = (c + t_1) - t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 t_2 = (a * b) * 0.25 t_3 = (c + (x * y)) - t_2 t_4 = c + ((x * y) + t_1) tmp = 0 if (x * y) <= -3.4e+128: tmp = t_4 elif (x * y) <= -4.5e+66: tmp = t_3 elif (x * y) <= -0.0053: tmp = t_4 elif (x * y) <= 1.65e+75: tmp = (c + t_1) - t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) t_2 = Float64(Float64(a * b) * 0.25) t_3 = Float64(Float64(c + Float64(x * y)) - t_2) t_4 = Float64(c + Float64(Float64(x * y) + t_1)) tmp = 0.0 if (Float64(x * y) <= -3.4e+128) tmp = t_4; elseif (Float64(x * y) <= -4.5e+66) tmp = t_3; elseif (Float64(x * y) <= -0.0053) tmp = t_4; elseif (Float64(x * y) <= 1.65e+75) tmp = Float64(Float64(c + t_1) - t_2); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; t_2 = (a * b) * 0.25; t_3 = (c + (x * y)) - t_2; t_4 = c + ((x * y) + t_1); tmp = 0.0; if ((x * y) <= -3.4e+128) tmp = t_4; elseif ((x * y) <= -4.5e+66) tmp = t_3; elseif ((x * y) <= -0.0053) tmp = t_4; elseif ((x * y) <= 1.65e+75) tmp = (c + t_1) - t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e+128], t$95$4, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e+66], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -0.0053], t$95$4, If[LessEqual[N[(x * y), $MachinePrecision], 1.65e+75], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
t_3 := \left(c + x \cdot y\right) - t_2\\
t_4 := c + \left(x \cdot y + t_1\right)\\
\mathbf{if}\;x \cdot y \leq -3.4 \cdot 10^{+128}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{+66}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -0.0053:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{+75}:\\
\;\;\;\;\left(c + t_1\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -3.3999999999999999e128 or -4.4999999999999998e66 < (*.f64 x y) < -0.00530000000000000002Initial program 95.9%
associate-+l-95.9%
fma-def98.0%
*-commutative98.0%
associate-/l*97.9%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in a around 0 93.8%
if -3.3999999999999999e128 < (*.f64 x y) < -4.4999999999999998e66 or 1.64999999999999999e75 < (*.f64 x y) Initial program 95.3%
associate-+l-95.3%
fma-def98.4%
*-commutative98.4%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in t around 0 95.2%
if -0.00530000000000000002 < (*.f64 x y) < 1.64999999999999999e75Initial program 99.3%
associate-+l-99.3%
fma-def99.3%
*-commutative99.3%
associate-/l*99.2%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around 0 94.7%
Final simplification94.7%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= (* x y) -9.5e+205)
(not
(or (<= (* x y) -2.7e+130)
(and (not (<= (* x y) -6.4e+36)) (<= (* x y) 8.5e+69)))))
(+ c (* x y))
(+ c (* (* z t) 0.0625))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -9.5e+205) || !(((x * y) <= -2.7e+130) || (!((x * y) <= -6.4e+36) && ((x * y) <= 8.5e+69)))) {
tmp = c + (x * y);
} else {
tmp = c + ((z * t) * 0.0625);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-9.5d+205)) .or. (.not. ((x * y) <= (-2.7d+130)) .or. (.not. ((x * y) <= (-6.4d+36))) .and. ((x * y) <= 8.5d+69))) then
tmp = c + (x * y)
else
tmp = c + ((z * t) * 0.0625d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -9.5e+205) || !(((x * y) <= -2.7e+130) || (!((x * y) <= -6.4e+36) && ((x * y) <= 8.5e+69)))) {
tmp = c + (x * y);
} else {
tmp = c + ((z * t) * 0.0625);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -9.5e+205) or not (((x * y) <= -2.7e+130) or (not ((x * y) <= -6.4e+36) and ((x * y) <= 8.5e+69))): tmp = c + (x * y) else: tmp = c + ((z * t) * 0.0625) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -9.5e+205) || !((Float64(x * y) <= -2.7e+130) || (!(Float64(x * y) <= -6.4e+36) && (Float64(x * y) <= 8.5e+69)))) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + 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) <= -9.5e+205) || ~((((x * y) <= -2.7e+130) || (~(((x * y) <= -6.4e+36)) && ((x * y) <= 8.5e+69))))) tmp = c + (x * y); else tmp = c + ((z * t) * 0.0625); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -9.5e+205], N[Not[Or[LessEqual[N[(x * y), $MachinePrecision], -2.7e+130], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -6.4e+36]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 8.5e+69]]]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+205} \lor \neg \left(x \cdot y \leq -2.7 \cdot 10^{+130} \lor \neg \left(x \cdot y \leq -6.4 \cdot 10^{+36}\right) \land x \cdot y \leq 8.5 \cdot 10^{+69}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + \left(z \cdot t\right) \cdot 0.0625\\
\end{array}
\end{array}
if (*.f64 x y) < -9.4999999999999997e205 or -2.6999999999999998e130 < (*.f64 x y) < -6.3999999999999998e36 or 8.5000000000000002e69 < (*.f64 x y) Initial program 94.8%
associate-+l-94.8%
fma-def97.9%
*-commutative97.9%
associate-/l*97.9%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in t around 0 92.8%
Taylor expanded in a around 0 77.4%
if -9.4999999999999997e205 < (*.f64 x y) < -2.6999999999999998e130 or -6.3999999999999998e36 < (*.f64 x y) < 8.5000000000000002e69Initial program 99.4%
associate-+l-99.4%
fma-def99.4%
*-commutative99.4%
associate-/l*99.3%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in a around 0 67.6%
Taylor expanded in t around inf 61.4%
Final simplification67.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+100) (not (<= (* a b) 10.0))) (- (+ 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) <= -1e+100) || !((a * b) <= 10.0)) {
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) <= (-1d+100)) .or. (.not. ((a * b) <= 10.0d0))) 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) <= -1e+100) || !((a * b) <= 10.0)) {
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) <= -1e+100) or not ((a * b) <= 10.0): 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) <= -1e+100) || !(Float64(a * b) <= 10.0)) 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) <= -1e+100) || ~(((a * b) <= 10.0))) 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], -1e+100], N[Not[LessEqual[N[(a * b), $MachinePrecision], 10.0]], $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 -1 \cdot 10^{+100} \lor \neg \left(a \cdot b \leq 10\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) < -1.00000000000000002e100 or 10 < (*.f64 a b) Initial program 97.0%
associate-+l-97.0%
fma-def97.0%
*-commutative97.0%
associate-/l*97.0%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in t around 0 87.6%
if -1.00000000000000002e100 < (*.f64 a b) < 10Initial program 98.1%
associate-+l-98.1%
fma-def100.0%
*-commutative100.0%
associate-/l*99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 90.8%
Final simplification89.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -1e+100)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 1e+139)
(+ c (+ (* x y) (* (* z t) 0.0625)))
(- (* 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+100) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 1e+139) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} 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+100)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 1d+139) then
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
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+100) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 1e+139) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} 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+100: tmp = c + (a * (b * -0.25)) elif (a * b) <= 1e+139: tmp = c + ((x * y) + ((z * t) * 0.0625)) 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+100) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 1e+139) tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); 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+100) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 1e+139) tmp = c + ((x * y) + ((z * t) * 0.0625)); 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+100], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+139], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $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 -1 \cdot 10^{+100}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+139}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e100Initial program 96.2%
Taylor expanded in a around inf 83.5%
*-commutative83.5%
associate-*l*83.5%
Simplified83.5%
if -1.00000000000000002e100 < (*.f64 a b) < 1.00000000000000003e139Initial program 98.4%
associate-+l-98.4%
fma-def100.0%
*-commutative100.0%
associate-/l*99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 88.6%
if 1.00000000000000003e139 < (*.f64 a b) Initial program 94.7%
associate-+l-94.7%
fma-def94.7%
*-commutative94.7%
associate-/l*94.7%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in t around 0 84.8%
Taylor expanded in c around 0 84.8%
Final simplification87.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))) (t_2 (+ c (* (* z t) 0.0625))))
(if (<= t -3.7e-97)
t_2
(if (<= t 3.7e-237)
t_1
(if (<= t 2.7e-139)
(+ c (* a (* b -0.25)))
(if (<= t 1.536e+84) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double t_2 = c + ((z * t) * 0.0625);
double tmp;
if (t <= -3.7e-97) {
tmp = t_2;
} else if (t <= 3.7e-237) {
tmp = t_1;
} else if (t <= 2.7e-139) {
tmp = c + (a * (b * -0.25));
} else if (t <= 1.536e+84) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) - ((a * b) * 0.25d0)
t_2 = c + ((z * t) * 0.0625d0)
if (t <= (-3.7d-97)) then
tmp = t_2
else if (t <= 3.7d-237) then
tmp = t_1
else if (t <= 2.7d-139) then
tmp = c + (a * (b * (-0.25d0)))
else if (t <= 1.536d+84) 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 = (x * y) - ((a * b) * 0.25);
double t_2 = c + ((z * t) * 0.0625);
double tmp;
if (t <= -3.7e-97) {
tmp = t_2;
} else if (t <= 3.7e-237) {
tmp = t_1;
} else if (t <= 2.7e-139) {
tmp = c + (a * (b * -0.25));
} else if (t <= 1.536e+84) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) t_2 = c + ((z * t) * 0.0625) tmp = 0 if t <= -3.7e-97: tmp = t_2 elif t <= 3.7e-237: tmp = t_1 elif t <= 2.7e-139: tmp = c + (a * (b * -0.25)) elif t <= 1.536e+84: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) t_2 = Float64(c + Float64(Float64(z * t) * 0.0625)) tmp = 0.0 if (t <= -3.7e-97) tmp = t_2; elseif (t <= 3.7e-237) tmp = t_1; elseif (t <= 2.7e-139) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (t <= 1.536e+84) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) * 0.25); t_2 = c + ((z * t) * 0.0625); tmp = 0.0; if (t <= -3.7e-97) tmp = t_2; elseif (t <= 3.7e-237) tmp = t_1; elseif (t <= 2.7e-139) tmp = c + (a * (b * -0.25)); elseif (t <= 1.536e+84) 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[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.7e-97], t$95$2, If[LessEqual[t, 3.7e-237], t$95$1, If[LessEqual[t, 2.7e-139], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.536e+84], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
t_2 := c + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{-97}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-237}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-139}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;t \leq 1.536 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.69999999999999976e-97 or 1.53599999999999999e84 < t Initial program 96.3%
associate-+l-96.3%
fma-def98.5%
*-commutative98.5%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in a around 0 80.5%
Taylor expanded in t around inf 63.5%
if -3.69999999999999976e-97 < t < 3.7000000000000001e-237 or 2.6999999999999998e-139 < t < 1.53599999999999999e84Initial program 99.0%
associate-+l-99.0%
fma-def99.0%
*-commutative99.0%
associate-/l*99.0%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around 0 90.0%
Taylor expanded in c around 0 67.5%
if 3.7000000000000001e-237 < t < 2.6999999999999998e-139Initial program 100.0%
Taylor expanded in a around inf 80.3%
*-commutative80.3%
associate-*l*80.3%
Simplified80.3%
Final simplification66.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= c -1e+118)
c
(if (<= c -1.4e+37)
(* x y)
(if (<= c -11500000000.0)
c
(if (<= c 1.85e-223)
(* (* a b) -0.25)
(if (<= c 1.15e+47) (* x y) c))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -1e+118) {
tmp = c;
} else if (c <= -1.4e+37) {
tmp = x * y;
} else if (c <= -11500000000.0) {
tmp = c;
} else if (c <= 1.85e-223) {
tmp = (a * b) * -0.25;
} else if (c <= 1.15e+47) {
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 (c <= (-1d+118)) then
tmp = c
else if (c <= (-1.4d+37)) then
tmp = x * y
else if (c <= (-11500000000.0d0)) then
tmp = c
else if (c <= 1.85d-223) then
tmp = (a * b) * (-0.25d0)
else if (c <= 1.15d+47) 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 (c <= -1e+118) {
tmp = c;
} else if (c <= -1.4e+37) {
tmp = x * y;
} else if (c <= -11500000000.0) {
tmp = c;
} else if (c <= 1.85e-223) {
tmp = (a * b) * -0.25;
} else if (c <= 1.15e+47) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if c <= -1e+118: tmp = c elif c <= -1.4e+37: tmp = x * y elif c <= -11500000000.0: tmp = c elif c <= 1.85e-223: tmp = (a * b) * -0.25 elif c <= 1.15e+47: tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -1e+118) tmp = c; elseif (c <= -1.4e+37) tmp = Float64(x * y); elseif (c <= -11500000000.0) tmp = c; elseif (c <= 1.85e-223) tmp = Float64(Float64(a * b) * -0.25); elseif (c <= 1.15e+47) 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 (c <= -1e+118) tmp = c; elseif (c <= -1.4e+37) tmp = x * y; elseif (c <= -11500000000.0) tmp = c; elseif (c <= 1.85e-223) tmp = (a * b) * -0.25; elseif (c <= 1.15e+47) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -1e+118], c, If[LessEqual[c, -1.4e+37], N[(x * y), $MachinePrecision], If[LessEqual[c, -11500000000.0], c, If[LessEqual[c, 1.85e-223], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], If[LessEqual[c, 1.15e+47], N[(x * y), $MachinePrecision], c]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1 \cdot 10^{+118}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq -1.4 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \leq -11500000000:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 1.85 \cdot 10^{-223}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{+47}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -9.99999999999999967e117 or -1.3999999999999999e37 < c < -1.15e10 or 1.1499999999999999e47 < c Initial program 95.9%
associate-+l-95.9%
fma-def99.0%
*-commutative99.0%
associate-/l*99.0%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in c around inf 56.4%
if -9.99999999999999967e117 < c < -1.3999999999999999e37 or 1.8499999999999999e-223 < c < 1.1499999999999999e47Initial program 98.4%
associate-+l-98.4%
fma-def98.4%
*-commutative98.4%
associate-/l*98.3%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in t around 0 70.0%
Taylor expanded in x around inf 50.6%
if -1.15e10 < c < 1.8499999999999999e-223Initial program 98.9%
associate-+l-98.9%
fma-def98.9%
*-commutative98.9%
associate-/l*98.9%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in t around 0 66.9%
Taylor expanded in a around inf 43.6%
*-commutative43.6%
Simplified43.6%
Final simplification50.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1.8e+169) (not (<= (* a b) 9e+141))) (* (* 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 * b) <= -1.8e+169) || !((a * b) <= 9e+141)) {
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 * b) <= (-1.8d+169)) .or. (.not. ((a * b) <= 9d+141))) 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 * b) <= -1.8e+169) || !((a * b) <= 9e+141)) {
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 * b) <= -1.8e+169) or not ((a * b) <= 9e+141): 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 ((Float64(a * b) <= -1.8e+169) || !(Float64(a * b) <= 9e+141)) tmp = Float64(Float64(a * 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 * b) <= -1.8e+169) || ~(((a * b) <= 9e+141))) 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[N[(a * b), $MachinePrecision], -1.8e+169], N[Not[LessEqual[N[(a * b), $MachinePrecision], 9e+141]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+169} \lor \neg \left(a \cdot b \leq 9 \cdot 10^{+141}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -1.80000000000000005e169 or 9.0000000000000003e141 < (*.f64 a b) Initial program 94.9%
associate-+l-94.9%
fma-def94.9%
*-commutative94.9%
associate-/l*94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in t around 0 90.0%
Taylor expanded in a around inf 81.5%
*-commutative81.5%
Simplified81.5%
if -1.80000000000000005e169 < (*.f64 a b) < 9.0000000000000003e141Initial program 98.5%
associate-+l-98.5%
fma-def100.0%
*-commutative100.0%
associate-/l*99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 70.9%
Taylor expanded in a around 0 59.4%
Final simplification64.5%
(FPCore (x y z t a b c) :precision binary64 (if (<= c -3.1e+114) c (if (<= c 1.45e+44) (* x y) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -3.1e+114) {
tmp = c;
} else if (c <= 1.45e+44) {
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 (c <= (-3.1d+114)) then
tmp = c
else if (c <= 1.45d+44) 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 (c <= -3.1e+114) {
tmp = c;
} else if (c <= 1.45e+44) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if c <= -3.1e+114: tmp = c elif c <= 1.45e+44: tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -3.1e+114) tmp = c; elseif (c <= 1.45e+44) 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 (c <= -3.1e+114) tmp = c; elseif (c <= 1.45e+44) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -3.1e+114], c, If[LessEqual[c, 1.45e+44], N[(x * y), $MachinePrecision], c]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.1 \cdot 10^{+114}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{+44}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -3.1e114 or 1.4500000000000001e44 < c Initial program 96.7%
associate-+l-96.7%
fma-def98.9%
*-commutative98.9%
associate-/l*98.9%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in c around inf 57.3%
if -3.1e114 < c < 1.4500000000000001e44Initial program 98.2%
associate-+l-98.2%
fma-def98.8%
*-commutative98.8%
associate-/l*98.7%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in t around 0 67.1%
Taylor expanded in x around inf 33.1%
Final simplification41.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 97.7%
associate-+l-97.7%
fma-def98.8%
*-commutative98.8%
associate-/l*98.8%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in c around inf 23.5%
Final simplification23.5%
herbie shell --seed 2023290
(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))