
(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 (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY) (+ c (- (+ (* x y) (* z (* t 0.0625))) (/ a (/ 4.0 b)))) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = c + (((x * y) + (z * (t * 0.0625))) - (a / (4.0 / b)));
} 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 tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= Double.POSITIVE_INFINITY) {
tmp = c + (((x * y) + (z * (t * 0.0625))) - (a / (4.0 / b)));
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= math.inf: tmp = c + (((x * y) + (z * (t * 0.0625))) - (a / (4.0 / b))) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(c + Float64(Float64(Float64(x * y) + Float64(z * Float64(t * 0.0625))) - Float64(a / Float64(4.0 / b)))); 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 ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= Inf) tmp = c + (((x * y) + (z * (t * 0.0625))) - (a / (4.0 / b))); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;c + \left(\left(x \cdot y + z \cdot \left(t \cdot 0.0625\right)\right) - \frac{a}{\frac{4}{b}}\right)\\
\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 99.6%
+-commutative99.6%
+-commutative99.6%
fma-def99.6%
associate-/l*99.8%
associate-/l*99.8%
Simplified99.8%
fma-udef99.8%
associate-/l*99.6%
+-commutative99.6%
div-inv99.6%
associate-*l*99.9%
metadata-eval99.9%
Applied egg-rr99.9%
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 x around inf 63.7%
Final simplification98.8%
(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.3%
associate-*l/97.6%
fma-neg97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
associate-/l*97.6%
distribute-frac-neg97.6%
associate-/r/97.6%
fma-def97.6%
neg-mul-197.6%
*-commutative97.6%
associate-/l*97.6%
metadata-eval97.6%
Simplified97.6%
Final simplification97.6%
(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 99.6%
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 x around inf 63.7%
Final simplification98.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1.5e+79)
t_2
(if (<= (* x y) 4.4e-103)
t_1
(if (<= (* x y) 3.8e-39)
(* t (* z 0.0625))
(if (<= (* x y) 1.5e+134) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.5e+79) {
tmp = t_2;
} else if ((x * y) <= 4.4e-103) {
tmp = t_1;
} else if ((x * y) <= 3.8e-39) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 1.5e+134) {
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 + (b * (a * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-1.5d+79)) then
tmp = t_2
else if ((x * y) <= 4.4d-103) then
tmp = t_1
else if ((x * y) <= 3.8d-39) then
tmp = t * (z * 0.0625d0)
else if ((x * y) <= 1.5d+134) 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 + (b * (a * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.5e+79) {
tmp = t_2;
} else if ((x * y) <= 4.4e-103) {
tmp = t_1;
} else if ((x * y) <= 3.8e-39) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 1.5e+134) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (b * (a * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1.5e+79: tmp = t_2 elif (x * y) <= 4.4e-103: tmp = t_1 elif (x * y) <= 3.8e-39: tmp = t * (z * 0.0625) elif (x * y) <= 1.5e+134: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(b * Float64(a * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.5e+79) tmp = t_2; elseif (Float64(x * y) <= 4.4e-103) tmp = t_1; elseif (Float64(x * y) <= 3.8e-39) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(x * y) <= 1.5e+134) 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 + (b * (a * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.5e+79) tmp = t_2; elseif ((x * y) <= 4.4e-103) tmp = t_1; elseif ((x * y) <= 3.8e-39) tmp = t * (z * 0.0625); elseif ((x * y) <= 1.5e+134) 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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e+79], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4.4e-103], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.8e-39], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.5e+134], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{+79}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 4.4 \cdot 10^{-103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{-39}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.49999999999999987e79 or 1.49999999999999998e134 < (*.f64 x y) Initial program 89.7%
Taylor expanded in x around inf 77.2%
if -1.49999999999999987e79 < (*.f64 x y) < 4.3999999999999999e-103 or 3.8000000000000002e-39 < (*.f64 x y) < 1.49999999999999998e134Initial program 100.0%
Taylor expanded in a around inf 62.6%
associate-*r*62.6%
*-commutative62.6%
*-commutative62.6%
Simplified62.6%
if 4.3999999999999999e-103 < (*.f64 x y) < 3.8000000000000002e-39Initial program 91.7%
Taylor expanded in x around 0 91.7%
cancel-sign-sub-inv91.7%
metadata-eval91.7%
+-commutative91.7%
associate-*r*91.7%
*-commutative91.7%
*-commutative91.7%
*-commutative91.7%
*-commutative91.7%
associate-*r*91.7%
fma-def100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
Simplified76.3%
Final simplification67.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -5.6e+78)
t_2
(if (<= (* x y) 5.8e-192)
t_1
(if (<= (* x y) 5.5e-105)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 1.5e+45) 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 + (x * y);
double tmp;
if ((x * y) <= -5.6e+78) {
tmp = t_2;
} else if ((x * y) <= 5.8e-192) {
tmp = t_1;
} else if ((x * y) <= 5.5e-105) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1.5e+45) {
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 + (t * (z * 0.0625d0))
t_2 = c + (x * y)
if ((x * y) <= (-5.6d+78)) then
tmp = t_2
else if ((x * y) <= 5.8d-192) then
tmp = t_1
else if ((x * y) <= 5.5d-105) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 1.5d+45) 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 + (x * y);
double tmp;
if ((x * y) <= -5.6e+78) {
tmp = t_2;
} else if ((x * y) <= 5.8e-192) {
tmp = t_1;
} else if ((x * y) <= 5.5e-105) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1.5e+45) {
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 + (x * y) tmp = 0 if (x * y) <= -5.6e+78: tmp = t_2 elif (x * y) <= 5.8e-192: tmp = t_1 elif (x * y) <= 5.5e-105: tmp = c + (b * (a * -0.25)) elif (x * y) <= 1.5e+45: 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(x * y)) tmp = 0.0 if (Float64(x * y) <= -5.6e+78) tmp = t_2; elseif (Float64(x * y) <= 5.8e-192) tmp = t_1; elseif (Float64(x * y) <= 5.5e-105) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 1.5e+45) 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 + (x * y); tmp = 0.0; if ((x * y) <= -5.6e+78) tmp = t_2; elseif ((x * y) <= 5.8e-192) tmp = t_1; elseif ((x * y) <= 5.5e-105) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 1.5e+45) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.6e+78], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.8e-192], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.5e-105], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.5e+45], 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 + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -5.6 \cdot 10^{+78}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{-105}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.6000000000000002e78 or 1.50000000000000005e45 < (*.f64 x y) Initial program 91.9%
Taylor expanded in x around inf 70.2%
if -5.6000000000000002e78 < (*.f64 x y) < 5.80000000000000033e-192 or 5.50000000000000029e-105 < (*.f64 x y) < 1.50000000000000005e45Initial program 99.3%
Taylor expanded in z around inf 70.2%
*-commutative70.2%
associate-*r*70.2%
*-commutative70.2%
Simplified70.2%
if 5.80000000000000033e-192 < (*.f64 x y) < 5.50000000000000029e-105Initial program 100.0%
Taylor expanded in a around inf 86.9%
associate-*r*86.9%
*-commutative86.9%
*-commutative86.9%
Simplified86.9%
Final simplification71.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25))
(t_2 (* (* z t) 0.0625))
(t_3 (+ c (- (* x y) t_1))))
(if (<= (* a b) -2e+116)
t_3
(if (<= (* a b) 5e-38)
(+ c (+ (* x y) t_2))
(if (<= (* a b) 5e+196) t_3 (- t_2 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 t_2 = (z * t) * 0.0625;
double t_3 = c + ((x * y) - t_1);
double tmp;
if ((a * b) <= -2e+116) {
tmp = t_3;
} else if ((a * b) <= 5e-38) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 5e+196) {
tmp = t_3;
} else {
tmp = t_2 - 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = (z * t) * 0.0625d0
t_3 = c + ((x * y) - t_1)
if ((a * b) <= (-2d+116)) then
tmp = t_3
else if ((a * b) <= 5d-38) then
tmp = c + ((x * y) + t_2)
else if ((a * b) <= 5d+196) then
tmp = t_3
else
tmp = t_2 - 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 t_2 = (z * t) * 0.0625;
double t_3 = c + ((x * y) - t_1);
double tmp;
if ((a * b) <= -2e+116) {
tmp = t_3;
} else if ((a * b) <= 5e-38) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 5e+196) {
tmp = t_3;
} else {
tmp = t_2 - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = (z * t) * 0.0625 t_3 = c + ((x * y) - t_1) tmp = 0 if (a * b) <= -2e+116: tmp = t_3 elif (a * b) <= 5e-38: tmp = c + ((x * y) + t_2) elif (a * b) <= 5e+196: tmp = t_3 else: tmp = t_2 - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(Float64(z * t) * 0.0625) t_3 = Float64(c + Float64(Float64(x * y) - t_1)) tmp = 0.0 if (Float64(a * b) <= -2e+116) tmp = t_3; elseif (Float64(a * b) <= 5e-38) tmp = Float64(c + Float64(Float64(x * y) + t_2)); elseif (Float64(a * b) <= 5e+196) tmp = t_3; else tmp = Float64(t_2 - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = (z * t) * 0.0625; t_3 = c + ((x * y) - t_1); tmp = 0.0; if ((a * b) <= -2e+116) tmp = t_3; elseif ((a * b) <= 5e-38) tmp = c + ((x * y) + t_2); elseif ((a * b) <= 5e+196) tmp = t_3; else tmp = t_2 - 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]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+116], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5e-38], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+196], t$95$3, N[(t$95$2 - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
t_3 := c + \left(x \cdot y - t_1\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+116}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-38}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+196}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000003e116 or 5.00000000000000033e-38 < (*.f64 a b) < 4.9999999999999998e196Initial program 93.6%
Taylor expanded in z around 0 82.2%
if -2.00000000000000003e116 < (*.f64 a b) < 5.00000000000000033e-38Initial program 99.4%
Taylor expanded in a around 0 96.2%
if 4.9999999999999998e196 < (*.f64 a b) Initial program 88.0%
+-commutative88.0%
+-commutative88.0%
fma-def92.0%
associate-/l*91.9%
associate-/l*91.7%
Simplified91.7%
fma-udef87.7%
associate-/l*87.8%
+-commutative87.8%
div-inv87.8%
associate-*l*87.8%
metadata-eval87.8%
Applied egg-rr87.8%
Taylor expanded in x around 0 96.0%
Taylor expanded in c around 0 96.0%
Final simplification91.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* (* a b) -0.25)))
(if (<= (* a b) -1.35e+115)
t_2
(if (<= (* a b) -2.45e-113)
t_1
(if (<= (* a b) -1.7e-199)
(* t (* z 0.0625))
(if (<= (* a b) 6.5e+76) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -1.35e+115) {
tmp = t_2;
} else if ((a * b) <= -2.45e-113) {
tmp = t_1;
} else if ((a * b) <= -1.7e-199) {
tmp = t * (z * 0.0625);
} else if ((a * b) <= 6.5e+76) {
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 + (x * y)
t_2 = (a * b) * (-0.25d0)
if ((a * b) <= (-1.35d+115)) then
tmp = t_2
else if ((a * b) <= (-2.45d-113)) then
tmp = t_1
else if ((a * b) <= (-1.7d-199)) then
tmp = t * (z * 0.0625d0)
else if ((a * b) <= 6.5d+76) 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 + (x * y);
double t_2 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -1.35e+115) {
tmp = t_2;
} else if ((a * b) <= -2.45e-113) {
tmp = t_1;
} else if ((a * b) <= -1.7e-199) {
tmp = t * (z * 0.0625);
} else if ((a * b) <= 6.5e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = (a * b) * -0.25 tmp = 0 if (a * b) <= -1.35e+115: tmp = t_2 elif (a * b) <= -2.45e-113: tmp = t_1 elif (a * b) <= -1.7e-199: tmp = t * (z * 0.0625) elif (a * b) <= 6.5e+76: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -1.35e+115) tmp = t_2; elseif (Float64(a * b) <= -2.45e-113) tmp = t_1; elseif (Float64(a * b) <= -1.7e-199) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(a * b) <= 6.5e+76) 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 + (x * y); t_2 = (a * b) * -0.25; tmp = 0.0; if ((a * b) <= -1.35e+115) tmp = t_2; elseif ((a * b) <= -2.45e-113) tmp = t_1; elseif ((a * b) <= -1.7e-199) tmp = t * (z * 0.0625); elseif ((a * b) <= 6.5e+76) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.35e+115], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2.45e-113], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.7e-199], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6.5e+76], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -1.35 \cdot 10^{+115}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -2.45 \cdot 10^{-113}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -1.7 \cdot 10^{-199}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;a \cdot b \leq 6.5 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.35000000000000002e115 or 6.5000000000000005e76 < (*.f64 a b) Initial program 91.5%
Taylor expanded in x around 0 86.4%
cancel-sign-sub-inv86.4%
metadata-eval86.4%
+-commutative86.4%
associate-*r*86.4%
*-commutative86.4%
*-commutative86.4%
*-commutative86.4%
*-commutative86.4%
associate-*r*86.4%
fma-def87.6%
*-commutative87.6%
associate-*l*87.6%
Simplified87.6%
Taylor expanded in b around inf 64.9%
if -1.35000000000000002e115 < (*.f64 a b) < -2.4500000000000001e-113 or -1.70000000000000003e-199 < (*.f64 a b) < 6.5000000000000005e76Initial program 98.8%
Taylor expanded in x around inf 64.4%
if -2.4500000000000001e-113 < (*.f64 a b) < -1.70000000000000003e-199Initial program 100.0%
Taylor expanded in x around 0 87.0%
cancel-sign-sub-inv87.0%
metadata-eval87.0%
+-commutative87.0%
associate-*r*87.0%
*-commutative87.0%
*-commutative87.0%
*-commutative87.0%
*-commutative87.0%
associate-*r*87.0%
fma-def87.0%
*-commutative87.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in t around inf 73.7%
associate-*r*73.7%
*-commutative73.7%
associate-*r*73.7%
Simplified73.7%
Final simplification65.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (or (<= (* a b) -4e+56) (not (<= (* a b) 1e+38)))
(+ c (- t_1 (* (* a b) 0.25)))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if (((a * b) <= -4e+56) || !((a * b) <= 1e+38)) {
tmp = c + (t_1 - ((a * b) * 0.25));
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (z * t) * 0.0625d0
if (((a * b) <= (-4d+56)) .or. (.not. ((a * b) <= 1d+38))) then
tmp = c + (t_1 - ((a * b) * 0.25d0))
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if (((a * b) <= -4e+56) || !((a * b) <= 1e+38)) {
tmp = c + (t_1 - ((a * b) * 0.25));
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if ((a * b) <= -4e+56) or not ((a * b) <= 1e+38): tmp = c + (t_1 - ((a * b) * 0.25)) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if ((Float64(a * b) <= -4e+56) || !(Float64(a * b) <= 1e+38)) tmp = Float64(c + Float64(t_1 - Float64(Float64(a * b) * 0.25))); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; tmp = 0.0; if (((a * b) <= -4e+56) || ~(((a * b) <= 1e+38))) tmp = c + (t_1 - ((a * b) * 0.25)); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -4e+56], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+38]], $MachinePrecision]], N[(c + N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+56} \lor \neg \left(a \cdot b \leq 10^{+38}\right):\\
\;\;\;\;c + \left(t_1 - \left(a \cdot b\right) \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.00000000000000037e56 or 9.99999999999999977e37 < (*.f64 a b) Initial program 93.1%
Taylor expanded in x around 0 85.2%
if -4.00000000000000037e56 < (*.f64 a b) < 9.99999999999999977e37Initial program 98.8%
Taylor expanded in a around 0 96.2%
Final simplification91.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+116) (not (<= (* a b) 1e+77))) (+ c (* b (* a -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) <= -2e+116) || !((a * b) <= 1e+77)) {
tmp = c + (b * (a * -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) <= (-2d+116)) .or. (.not. ((a * b) <= 1d+77))) then
tmp = c + (b * (a * (-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) <= -2e+116) || !((a * b) <= 1e+77)) {
tmp = c + (b * (a * -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) <= -2e+116) or not ((a * b) <= 1e+77): tmp = c + (b * (a * -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) <= -2e+116) || !(Float64(a * b) <= 1e+77)) tmp = Float64(c + Float64(b * Float64(a * -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) <= -2e+116) || ~(((a * b) <= 1e+77))) tmp = c + (b * (a * -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], -2e+116], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+77]], $MachinePrecision]], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+116} \lor \neg \left(a \cdot b \leq 10^{+77}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000003e116 or 9.99999999999999983e76 < (*.f64 a b) Initial program 91.4%
Taylor expanded in a around inf 70.4%
associate-*r*70.4%
*-commutative70.4%
*-commutative70.4%
Simplified70.4%
if -2.00000000000000003e116 < (*.f64 a b) < 9.99999999999999983e76Initial program 98.9%
Taylor expanded in a around 0 93.4%
Final simplification86.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+116) (not (<= (* a b) 5e-38))) (+ 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) <= -2e+116) || !((a * b) <= 5e-38)) {
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) <= (-2d+116)) .or. (.not. ((a * b) <= 5d-38))) 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) <= -2e+116) || !((a * b) <= 5e-38)) {
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) <= -2e+116) or not ((a * b) <= 5e-38): 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) <= -2e+116) || !(Float64(a * b) <= 5e-38)) tmp = Float64(c + Float64(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) <= -2e+116) || ~(((a * b) <= 5e-38))) 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], -2e+116], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e-38]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+116} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{-38}\right):\\
\;\;\;\;c + \left(x \cdot y - \left(a \cdot b\right) \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000003e116 or 5.00000000000000033e-38 < (*.f64 a b) Initial program 92.2%
Taylor expanded in z around 0 80.7%
if -2.00000000000000003e116 < (*.f64 a b) < 5.00000000000000033e-38Initial program 99.4%
Taylor expanded in a around 0 96.2%
Final simplification89.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)))
(if (<= (* a b) -2.55e+92)
t_1
(if (<= (* a b) -8.4e-201)
(* t (* z 0.0625))
(if (<= (* a b) 2.3e-13) c t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -2.55e+92) {
tmp = t_1;
} else if ((a * b) <= -8.4e-201) {
tmp = t * (z * 0.0625);
} else if ((a * b) <= 2.3e-13) {
tmp = c;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) * (-0.25d0)
if ((a * b) <= (-2.55d+92)) then
tmp = t_1
else if ((a * b) <= (-8.4d-201)) then
tmp = t * (z * 0.0625d0)
else if ((a * b) <= 2.3d-13) then
tmp = c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -2.55e+92) {
tmp = t_1;
} else if ((a * b) <= -8.4e-201) {
tmp = t * (z * 0.0625);
} else if ((a * b) <= 2.3e-13) {
tmp = c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * -0.25 tmp = 0 if (a * b) <= -2.55e+92: tmp = t_1 elif (a * b) <= -8.4e-201: tmp = t * (z * 0.0625) elif (a * b) <= 2.3e-13: tmp = c else: tmp = 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 (Float64(a * b) <= -2.55e+92) tmp = t_1; elseif (Float64(a * b) <= -8.4e-201) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(a * b) <= 2.3e-13) tmp = c; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * -0.25; tmp = 0.0; if ((a * b) <= -2.55e+92) tmp = t_1; elseif ((a * b) <= -8.4e-201) tmp = t * (z * 0.0625); elseif ((a * b) <= 2.3e-13) tmp = c; else tmp = 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[LessEqual[N[(a * b), $MachinePrecision], -2.55e+92], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -8.4e-201], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.3e-13], c, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -2.55 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -8.4 \cdot 10^{-201}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.5500000000000001e92 or 2.29999999999999979e-13 < (*.f64 a b) Initial program 92.3%
Taylor expanded in x around 0 81.4%
cancel-sign-sub-inv81.4%
metadata-eval81.4%
+-commutative81.4%
associate-*r*81.4%
*-commutative81.4%
*-commutative81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r*81.4%
fma-def82.4%
*-commutative82.4%
associate-*l*82.4%
Simplified82.4%
Taylor expanded in b around inf 56.5%
if -2.5500000000000001e92 < (*.f64 a b) < -8.40000000000000049e-201Initial program 100.0%
Taylor expanded in x around 0 75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
+-commutative75.4%
associate-*r*75.4%
*-commutative75.4%
*-commutative75.4%
*-commutative75.4%
*-commutative75.4%
associate-*r*75.4%
fma-def75.4%
*-commutative75.4%
associate-*l*75.4%
Simplified75.4%
Taylor expanded in t around inf 51.7%
associate-*r*51.7%
*-commutative51.7%
associate-*r*51.7%
Simplified51.7%
if -8.40000000000000049e-201 < (*.f64 a b) < 2.29999999999999979e-13Initial program 99.1%
associate-+l-99.1%
associate--l+99.1%
fma-def99.1%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in c around inf 37.7%
Final simplification48.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -3.2e+36) (not (<= (* a b) 2e-16))) (* (* a b) -0.25) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -3.2e+36) || !((a * b) <= 2e-16)) {
tmp = (a * b) * -0.25;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-3.2d+36)) .or. (.not. ((a * b) <= 2d-16))) then
tmp = (a * b) * (-0.25d0)
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -3.2e+36) || !((a * b) <= 2e-16)) {
tmp = (a * b) * -0.25;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -3.2e+36) or not ((a * b) <= 2e-16): tmp = (a * b) * -0.25 else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -3.2e+36) || !(Float64(a * b) <= 2e-16)) tmp = Float64(Float64(a * b) * -0.25); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -3.2e+36) || ~(((a * b) <= 2e-16))) tmp = (a * b) * -0.25; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -3.2e+36], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e-16]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.2 \cdot 10^{+36} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{-16}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 a b) < -3.1999999999999999e36 or 2e-16 < (*.f64 a b) Initial program 93.1%
Taylor expanded in x around 0 81.7%
cancel-sign-sub-inv81.7%
metadata-eval81.7%
+-commutative81.7%
associate-*r*81.7%
*-commutative81.7%
*-commutative81.7%
*-commutative81.7%
*-commutative81.7%
associate-*r*81.7%
fma-def82.6%
*-commutative82.6%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in b around inf 53.6%
if -3.1999999999999999e36 < (*.f64 a b) < 2e-16Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
fma-def99.4%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in c around inf 31.9%
Final simplification41.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 96.5%
associate-+l-96.5%
associate--l+96.5%
fma-def97.3%
associate-*l/97.6%
fma-neg97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
associate-/l*97.6%
distribute-frac-neg97.6%
associate-/r/97.6%
fma-def97.6%
neg-mul-197.6%
*-commutative97.6%
associate-/l*97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in c around inf 22.7%
Final simplification22.7%
herbie shell --seed 2023320
(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))