
(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 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* x y)))))
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 + (x * y);
}
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 + (x * y);
}
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 + (x * y) 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(c + Float64(x * y)); 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 + (x * y); 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[(c + N[(x * y), $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}:\\
\;\;\;\;c + x \cdot y\\
\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%
Taylor expanded in a around 0 16.7%
Taylor expanded in t around 0 68.3%
Final simplification99.2%
(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.6%
associate-+l-97.6%
associate--l+97.6%
fma-def97.6%
associate-*l/97.6%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*98.4%
distribute-frac-neg98.4%
associate-/r/98.4%
fma-def98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (/ z (/ 16.0 t))) (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z / (16.0 / t))) - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z / Float64(16.0 / t))) - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-+l-97.6%
fma-def97.6%
*-commutative97.6%
associate-/l*97.6%
associate-/l*97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* x y) -0.0125)
(* x y)
(if (<= (* x y) -1.25e-154)
t_1
(if (<= (* x y) 1.4e-89)
c
(if (<= (* x y) 4.8e+123)
t_1
(if (<= (* x y) 1.25e+212) 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 tmp;
if ((x * y) <= -0.0125) {
tmp = x * y;
} else if ((x * y) <= -1.25e-154) {
tmp = t_1;
} else if ((x * y) <= 1.4e-89) {
tmp = c;
} else if ((x * y) <= 4.8e+123) {
tmp = t_1;
} else if ((x * y) <= 1.25e+212) {
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 = a * (b * (-0.25d0))
if ((x * y) <= (-0.0125d0)) then
tmp = x * y
else if ((x * y) <= (-1.25d-154)) then
tmp = t_1
else if ((x * y) <= 1.4d-89) then
tmp = c
else if ((x * y) <= 4.8d+123) then
tmp = t_1
else if ((x * y) <= 1.25d+212) 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 = a * (b * -0.25);
double tmp;
if ((x * y) <= -0.0125) {
tmp = x * y;
} else if ((x * y) <= -1.25e-154) {
tmp = t_1;
} else if ((x * y) <= 1.4e-89) {
tmp = c;
} else if ((x * y) <= 4.8e+123) {
tmp = t_1;
} else if ((x * y) <= 1.25e+212) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if (x * y) <= -0.0125: tmp = x * y elif (x * y) <= -1.25e-154: tmp = t_1 elif (x * y) <= 1.4e-89: tmp = c elif (x * y) <= 4.8e+123: tmp = t_1 elif (x * y) <= 1.25e+212: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(x * y) <= -0.0125) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.25e-154) tmp = t_1; elseif (Float64(x * y) <= 1.4e-89) tmp = c; elseif (Float64(x * y) <= 4.8e+123) tmp = t_1; elseif (Float64(x * y) <= 1.25e+212) tmp = c; else tmp = Float64(x * y); 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 ((x * y) <= -0.0125) tmp = x * y; elseif ((x * y) <= -1.25e-154) tmp = t_1; elseif ((x * y) <= 1.4e-89) tmp = c; elseif ((x * y) <= 4.8e+123) tmp = t_1; elseif ((x * y) <= 1.25e+212) tmp = c; else tmp = 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]}, If[LessEqual[N[(x * y), $MachinePrecision], -0.0125], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.25e-154], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-89], c, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e+123], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.25e+212], c, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -0.0125:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.25 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-89}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.25 \cdot 10^{+212}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -0.012500000000000001 or 1.24999999999999998e212 < (*.f64 x y) Initial program 93.8%
Taylor expanded in a around 0 84.0%
Taylor expanded in t around 0 72.2%
Taylor expanded in c around 0 60.0%
if -0.012500000000000001 < (*.f64 x y) < -1.25000000000000005e-154 or 1.3999999999999999e-89 < (*.f64 x y) < 4.79999999999999978e123Initial program 98.7%
Taylor expanded in x around 0 89.9%
associate--l+89.9%
sub-neg89.9%
+-commutative89.9%
associate-+r+89.9%
+-commutative89.9%
distribute-lft-neg-in89.9%
metadata-eval89.9%
associate-*r*89.9%
*-commutative89.9%
fma-udef89.9%
*-commutative89.9%
*-commutative89.9%
associate-*r*89.9%
+-commutative89.9%
fma-def91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in a around inf 47.2%
associate-*r*47.2%
*-commutative47.2%
associate-*l*47.2%
Simplified47.2%
if -1.25000000000000005e-154 < (*.f64 x y) < 1.3999999999999999e-89 or 4.79999999999999978e123 < (*.f64 x y) < 1.24999999999999998e212Initial program 100.0%
Taylor expanded in c around inf 50.6%
Final simplification52.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -0.42)
t_2
(if (<= (* x y) 8.8e-229)
t_1
(if (<= (* x y) 4800000.0)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 5.8e+176) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -0.42) {
tmp = t_2;
} else if ((x * y) <= 8.8e-229) {
tmp = t_1;
} else if ((x * y) <= 4800000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 5.8e+176) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-0.42d0)) then
tmp = t_2
else if ((x * y) <= 8.8d-229) then
tmp = t_1
else if ((x * y) <= 4800000.0d0) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 5.8d+176) 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 + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -0.42) {
tmp = t_2;
} else if ((x * y) <= 8.8e-229) {
tmp = t_1;
} else if ((x * y) <= 4800000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 5.8e+176) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -0.42: tmp = t_2 elif (x * y) <= 8.8e-229: tmp = t_1 elif (x * y) <= 4800000.0: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 5.8e+176: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -0.42) tmp = t_2; elseif (Float64(x * y) <= 8.8e-229) tmp = t_1; elseif (Float64(x * y) <= 4800000.0) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 5.8e+176) 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 + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -0.42) tmp = t_2; elseif ((x * y) <= 8.8e-229) tmp = t_1; elseif ((x * y) <= 4800000.0) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 5.8e+176) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -0.42], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 8.8e-229], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4800000.0], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.8e+176], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -0.42:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4800000:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -0.419999999999999984 or 5.8000000000000003e176 < (*.f64 x y) Initial program 94.0%
Taylor expanded in a around 0 84.7%
Taylor expanded in t around 0 73.5%
if -0.419999999999999984 < (*.f64 x y) < 8.7999999999999996e-229 or 4.8e6 < (*.f64 x y) < 5.8000000000000003e176Initial program 100.0%
Taylor expanded in a around inf 73.4%
*-commutative73.4%
associate-*r*73.4%
Simplified73.4%
if 8.7999999999999996e-229 < (*.f64 x y) < 4.8e6Initial program 98.0%
Taylor expanded in x around 0 88.8%
associate--l+88.8%
sub-neg88.8%
+-commutative88.8%
associate-+r+88.8%
+-commutative88.8%
distribute-lft-neg-in88.8%
metadata-eval88.8%
associate-*r*88.8%
*-commutative88.8%
fma-udef88.8%
*-commutative88.8%
*-commutative88.8%
associate-*r*88.8%
+-commutative88.8%
fma-def90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in a around 0 70.6%
Final simplification72.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -260000.0)
t_1
(if (<= (* x y) 1.55e-229)
(- c (* (* a b) 0.25))
(if (<= (* x y) 1600000.0)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 7.6e+165) (+ c (* a (* b -0.25))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -260000.0) {
tmp = t_1;
} else if ((x * y) <= 1.55e-229) {
tmp = c - ((a * b) * 0.25);
} else if ((x * y) <= 1600000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 7.6e+165) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-260000.0d0)) then
tmp = t_1
else if ((x * y) <= 1.55d-229) then
tmp = c - ((a * b) * 0.25d0)
else if ((x * y) <= 1600000.0d0) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 7.6d+165) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -260000.0) {
tmp = t_1;
} else if ((x * y) <= 1.55e-229) {
tmp = c - ((a * b) * 0.25);
} else if ((x * y) <= 1600000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 7.6e+165) {
tmp = c + (a * (b * -0.25));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -260000.0: tmp = t_1 elif (x * y) <= 1.55e-229: tmp = c - ((a * b) * 0.25) elif (x * y) <= 1600000.0: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 7.6e+165: tmp = c + (a * (b * -0.25)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -260000.0) tmp = t_1; elseif (Float64(x * y) <= 1.55e-229) tmp = Float64(c - Float64(Float64(a * b) * 0.25)); elseif (Float64(x * y) <= 1600000.0) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 7.6e+165) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -260000.0) tmp = t_1; elseif ((x * y) <= 1.55e-229) tmp = c - ((a * b) * 0.25); elseif ((x * y) <= 1600000.0) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 7.6e+165) tmp = c + (a * (b * -0.25)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -260000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-229], N[(c - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1600000.0], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.6e+165], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -260000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-229}:\\
\;\;\;\;c - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;x \cdot y \leq 1600000:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 7.6 \cdot 10^{+165}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.6e5 or 7.59999999999999981e165 < (*.f64 x y) Initial program 94.2%
Taylor expanded in a around 0 85.1%
Taylor expanded in t around 0 73.9%
if -2.6e5 < (*.f64 x y) < 1.55e-229Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in t around 0 72.5%
if 1.55e-229 < (*.f64 x y) < 1.6e6Initial program 98.0%
Taylor expanded in x around 0 88.8%
associate--l+88.8%
sub-neg88.8%
+-commutative88.8%
associate-+r+88.8%
+-commutative88.8%
distribute-lft-neg-in88.8%
metadata-eval88.8%
associate-*r*88.8%
*-commutative88.8%
fma-udef88.8%
*-commutative88.8%
*-commutative88.8%
associate-*r*88.8%
+-commutative88.8%
fma-def90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in a around 0 70.6%
if 1.6e6 < (*.f64 x y) < 7.59999999999999981e165Initial program 100.0%
Taylor expanded in a around inf 74.4%
*-commutative74.4%
associate-*r*74.4%
Simplified74.4%
Final simplification72.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -750000000.0)
(+ (* x y) t_1)
(if (<= (* x y) 2.45e-224)
(- c (* (* a b) 0.25))
(if (<= (* x y) 16200000.0)
(+ c t_1)
(if (<= (* x y) 3.5e+166) (+ c (* a (* b -0.25))) (+ 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 ((x * y) <= -750000000.0) {
tmp = (x * y) + t_1;
} else if ((x * y) <= 2.45e-224) {
tmp = c - ((a * b) * 0.25);
} else if ((x * y) <= 16200000.0) {
tmp = c + t_1;
} else if ((x * y) <= 3.5e+166) {
tmp = c + (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) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((x * y) <= (-750000000.0d0)) then
tmp = (x * y) + t_1
else if ((x * y) <= 2.45d-224) then
tmp = c - ((a * b) * 0.25d0)
else if ((x * y) <= 16200000.0d0) then
tmp = c + t_1
else if ((x * y) <= 3.5d+166) then
tmp = c + (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 t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -750000000.0) {
tmp = (x * y) + t_1;
} else if ((x * y) <= 2.45e-224) {
tmp = c - ((a * b) * 0.25);
} else if ((x * y) <= 16200000.0) {
tmp = c + t_1;
} else if ((x * y) <= 3.5e+166) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -750000000.0: tmp = (x * y) + t_1 elif (x * y) <= 2.45e-224: tmp = c - ((a * b) * 0.25) elif (x * y) <= 16200000.0: tmp = c + t_1 elif (x * y) <= 3.5e+166: tmp = c + (a * (b * -0.25)) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -750000000.0) tmp = Float64(Float64(x * y) + t_1); elseif (Float64(x * y) <= 2.45e-224) tmp = Float64(c - Float64(Float64(a * b) * 0.25)); elseif (Float64(x * y) <= 16200000.0) tmp = Float64(c + t_1); elseif (Float64(x * y) <= 3.5e+166) tmp = Float64(c + 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) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -750000000.0) tmp = (x * y) + t_1; elseif ((x * y) <= 2.45e-224) tmp = c - ((a * b) * 0.25); elseif ((x * y) <= 16200000.0) tmp = c + t_1; elseif ((x * y) <= 3.5e+166) tmp = c + (a * (b * -0.25)); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -750000000.0], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.45e-224], N[(c - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 16200000.0], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.5e+166], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -750000000:\\
\;\;\;\;x \cdot y + t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.45 \cdot 10^{-224}:\\
\;\;\;\;c - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;x \cdot y \leq 16200000:\\
\;\;\;\;c + t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{+166}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.5e8Initial program 92.9%
Taylor expanded in a around 0 82.3%
Taylor expanded in c around 0 70.0%
if -7.5e8 < (*.f64 x y) < 2.4499999999999998e-224Initial program 100.0%
Taylor expanded in x around 0 99.6%
Taylor expanded in t around 0 72.3%
if 2.4499999999999998e-224 < (*.f64 x y) < 1.62e7Initial program 98.0%
Taylor expanded in x around 0 88.8%
associate--l+88.8%
sub-neg88.8%
+-commutative88.8%
associate-+r+88.8%
+-commutative88.8%
distribute-lft-neg-in88.8%
metadata-eval88.8%
associate-*r*88.8%
*-commutative88.8%
fma-udef88.8%
*-commutative88.8%
*-commutative88.8%
associate-*r*88.8%
+-commutative88.8%
fma-def90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in a around 0 70.6%
if 1.62e7 < (*.f64 x y) < 3.4999999999999999e166Initial program 100.0%
Taylor expanded in a around inf 74.4%
*-commutative74.4%
associate-*r*74.4%
Simplified74.4%
if 3.4999999999999999e166 < (*.f64 x y) Initial program 96.3%
Taylor expanded in a around 0 89.2%
Taylor expanded in t around 0 85.3%
Final simplification73.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (* (* a b) 0.25)))
(if (<= (* x y) -520000.0)
(+ c (+ (* x y) t_1))
(if (<= (* x y) 5.5e+39) (- (+ c t_1) t_2) (- (+ c (* x y)) t_2)))))
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 ((x * y) <= -520000.0) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 5.5e+39) {
tmp = (c + t_1) - t_2;
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = (a * b) * 0.25d0
if ((x * y) <= (-520000.0d0)) then
tmp = c + ((x * y) + t_1)
else if ((x * y) <= 5.5d+39) then
tmp = (c + t_1) - t_2
else
tmp = (c + (x * y)) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (a * b) * 0.25;
double tmp;
if ((x * y) <= -520000.0) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 5.5e+39) {
tmp = (c + t_1) - t_2;
} else {
tmp = (c + (x * y)) - t_2;
}
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 (x * y) <= -520000.0: tmp = c + ((x * y) + t_1) elif (x * y) <= 5.5e+39: tmp = (c + t_1) - t_2 else: tmp = (c + (x * y)) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (Float64(x * y) <= -520000.0) tmp = Float64(c + Float64(Float64(x * y) + t_1)); elseif (Float64(x * y) <= 5.5e+39) tmp = Float64(Float64(c + t_1) - t_2); else tmp = Float64(Float64(c + Float64(x * y)) - t_2); 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 ((x * y) <= -520000.0) tmp = c + ((x * y) + t_1); elseif ((x * y) <= 5.5e+39) tmp = (c + t_1) - t_2; else tmp = (c + (x * y)) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -520000.0], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.5e+39], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -520000:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+39}:\\
\;\;\;\;\left(c + t\_1\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.2e5Initial program 93.2%
Taylor expanded in a around 0 83.2%
if -5.2e5 < (*.f64 x y) < 5.4999999999999997e39Initial program 99.3%
Taylor expanded in x around 0 95.2%
if 5.4999999999999997e39 < (*.f64 x y) Initial program 98.1%
Taylor expanded in z around 0 92.5%
Final simplification91.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -1.1e+156)
t_1
(if (<= (* x y) 22000000.0)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 1.82e+50) (* a (* b -0.25)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1.1e+156) {
tmp = t_1;
} else if ((x * y) <= 22000000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 1.82e+50) {
tmp = a * (b * -0.25);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-1.1d+156)) then
tmp = t_1
else if ((x * y) <= 22000000.0d0) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 1.82d+50) then
tmp = a * (b * (-0.25d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1.1e+156) {
tmp = t_1;
} else if ((x * y) <= 22000000.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 1.82e+50) {
tmp = a * (b * -0.25);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -1.1e+156: tmp = t_1 elif (x * y) <= 22000000.0: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 1.82e+50: tmp = a * (b * -0.25) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.1e+156) tmp = t_1; elseif (Float64(x * y) <= 22000000.0) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 1.82e+50) tmp = Float64(a * Float64(b * -0.25)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.1e+156) tmp = t_1; elseif ((x * y) <= 22000000.0) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 1.82e+50) tmp = a * (b * -0.25); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.1e+156], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 22000000.0], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.82e+50], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.1 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 22000000:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 1.82 \cdot 10^{+50}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.10000000000000002e156 or 1.81999999999999997e50 < (*.f64 x y) Initial program 94.4%
Taylor expanded in a around 0 81.4%
Taylor expanded in t around 0 73.9%
if -1.10000000000000002e156 < (*.f64 x y) < 2.2e7Initial program 99.3%
Taylor expanded in x around 0 93.4%
associate--l+93.4%
sub-neg93.4%
+-commutative93.4%
associate-+r+93.4%
+-commutative93.4%
distribute-lft-neg-in93.4%
metadata-eval93.4%
associate-*r*93.4%
*-commutative93.4%
fma-udef93.4%
*-commutative93.4%
*-commutative93.4%
associate-*r*93.4%
+-commutative93.4%
fma-def94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in a around 0 66.3%
if 2.2e7 < (*.f64 x y) < 1.81999999999999997e50Initial program 99.9%
Taylor expanded in x around 0 91.9%
associate--l+91.9%
sub-neg91.9%
+-commutative91.9%
associate-+r+91.9%
+-commutative91.9%
distribute-lft-neg-in91.9%
metadata-eval91.9%
associate-*r*91.9%
*-commutative91.9%
fma-udef91.9%
*-commutative91.9%
*-commutative91.9%
associate-*r*91.9%
+-commutative91.9%
fma-def92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in a around inf 67.8%
associate-*r*67.8%
*-commutative67.8%
associate-*l*67.8%
Simplified67.8%
Final simplification69.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+76) (not (<= (* a b) 2e+19))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+76) || !((a * b) <= 2e+19)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-1d+76)) .or. (.not. ((a * b) <= 2d+19))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+76) || !((a * b) <= 2e+19)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1e+76) or not ((a * b) <= 2e+19): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1e+76) || !(Float64(a * b) <= 2e+19)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1e+76) || ~(((a * b) <= 2e+19))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+76], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+19]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+76} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+19}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1e76 or 2e19 < (*.f64 a b) Initial program 95.0%
Taylor expanded in z around 0 87.3%
if -1e76 < (*.f64 a b) < 2e19Initial program 99.3%
Taylor expanded in a around 0 93.0%
Final simplification90.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+182)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 2e+236)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* 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) <= -2e+182) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+236) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (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) <= (-2d+182)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+236) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (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) <= -2e+182) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+236) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2e+182: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 2e+236: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+182) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+236) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -2e+182) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 2e+236) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+182], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+236], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+236}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e182Initial program 93.3%
Taylor expanded in z around 0 93.2%
Taylor expanded in c around 0 93.2%
if -2.0000000000000001e182 < (*.f64 a b) < 2.00000000000000011e236Initial program 99.0%
Taylor expanded in a around 0 88.5%
if 2.00000000000000011e236 < (*.f64 a b) Initial program 90.5%
Taylor expanded in a around inf 95.2%
*-commutative95.2%
associate-*r*95.2%
Simplified95.2%
Final simplification89.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -800000000.0) (not (<= (* x y) 1.25e+212))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -800000000.0) || !((x * y) <= 1.25e+212)) {
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) <= (-800000000.0d0)) .or. (.not. ((x * y) <= 1.25d+212))) 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) <= -800000000.0) || !((x * y) <= 1.25e+212)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -800000000.0) or not ((x * y) <= 1.25e+212): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -800000000.0) || !(Float64(x * y) <= 1.25e+212)) 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) <= -800000000.0) || ~(((x * y) <= 1.25e+212))) 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], -800000000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.25e+212]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -800000000 \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+212}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -8e8 or 1.24999999999999998e212 < (*.f64 x y) Initial program 93.5%
Taylor expanded in a around 0 83.4%
Taylor expanded in t around 0 72.2%
Taylor expanded in c around 0 62.1%
if -8e8 < (*.f64 x y) < 1.24999999999999998e212Initial program 99.4%
Taylor expanded in c around inf 37.0%
Final simplification44.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.15e+144) (not (<= a 9.5e+17))) (* 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 <= -1.15e+144) || !(a <= 9.5e+17)) {
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 <= (-1.15d+144)) .or. (.not. (a <= 9.5d+17))) 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 <= -1.15e+144) || !(a <= 9.5e+17)) {
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 <= -1.15e+144) or not (a <= 9.5e+17): 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 <= -1.15e+144) || !(a <= 9.5e+17)) 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 <= -1.15e+144) || ~((a <= 9.5e+17))) 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, -1.15e+144], N[Not[LessEqual[a, 9.5e+17]], $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 -1.15 \cdot 10^{+144} \lor \neg \left(a \leq 9.5 \cdot 10^{+17}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.1500000000000001e144 or 9.5e17 < a Initial program 96.6%
Taylor expanded in x around 0 81.3%
associate--l+81.3%
sub-neg81.3%
+-commutative81.3%
associate-+r+81.3%
+-commutative81.3%
distribute-lft-neg-in81.3%
metadata-eval81.3%
associate-*r*81.3%
*-commutative81.3%
fma-udef81.3%
*-commutative81.3%
*-commutative81.3%
associate-*r*81.3%
+-commutative81.3%
fma-def82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in a around inf 41.3%
associate-*r*41.3%
*-commutative41.3%
associate-*l*41.3%
Simplified41.3%
if -1.1500000000000001e144 < a < 9.5e17Initial program 98.2%
Taylor expanded in a around 0 79.6%
Taylor expanded in t around 0 57.5%
Final simplification51.8%
(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.6%
Taylor expanded in c around inf 29.4%
Final simplification29.4%
herbie shell --seed 2024031
(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))