
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (fma (* a -0.25) b (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + fma(Float64(a * -0.25), b, Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + \mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in z around 0 30.0%
sub-neg30.0%
+-commutative30.0%
distribute-lft-neg-in30.0%
metadata-eval30.0%
associate-*r*30.0%
*-commutative30.0%
*-commutative30.0%
fma-def60.0%
*-commutative60.0%
Simplified60.0%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 96.1%
associate-+l-96.1%
associate--l+96.1%
fma-def97.2%
associate-*l/97.2%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*98.0%
distribute-frac-neg98.0%
associate-/r/98.0%
fma-def98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*98.0%
metadata-eval98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma (* a -0.25) b (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = fma(Float64(a * -0.25), b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in z around 0 30.0%
Taylor expanded in c around 0 30.0%
cancel-sign-sub-inv30.0%
metadata-eval30.0%
*-commutative30.0%
+-commutative30.0%
*-commutative30.0%
associate-*r*30.0%
*-commutative30.0%
fma-udef60.0%
Applied egg-rr60.0%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = 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 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;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%
associate-+l-0.0%
fma-def20.0%
*-commutative20.0%
associate-/l*20.0%
associate-/l*20.0%
Simplified20.0%
fma-udef0.0%
div-inv0.0%
clear-num0.0%
div-inv0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 40.7%
Final simplification97.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+134)
(- (+ c (* x y)) t_1)
(if (<= (* a b) 4e+134) (+ c (+ (* x y) t_2)) (- (+ c 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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+134) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 4e+134) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + 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) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+134)) then
tmp = (c + (x * y)) - t_1
else if ((a * b) <= 4d+134) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + 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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+134) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 4e+134) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+134: tmp = (c + (x * y)) - t_1 elif (a * b) <= 4e+134: tmp = c + ((x * y) + t_2) else: tmp = (c + 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(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+134) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(a * b) <= 4e+134) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + 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 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+134) tmp = (c + (x * y)) - t_1; elseif ((a * b) <= 4e+134) tmp = c + ((x * y) + t_2); else tmp = (c + 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+134], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e+134], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+134}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+134}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999981e134Initial program 85.7%
Taylor expanded in z around 0 83.2%
if -4.99999999999999981e134 < (*.f64 a b) < 3.99999999999999969e134Initial program 98.4%
Taylor expanded in a around 0 91.3%
if 3.99999999999999969e134 < (*.f64 a b) Initial program 93.3%
Taylor expanded in x around 0 93.3%
Final simplification90.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= z -4.6e+18)
t_2
(if (<= z -3.3e-108)
t_1
(if (<= z -4.8e-191)
c
(if (<= z 5.8e-258)
(* x y)
(if (<= z 5.5e-166)
t_1
(if (<= z 3.7e-118) c (if (<= z 1.9e-40) t_1 t_2)))))))))
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 = 0.0625 * (z * t);
double tmp;
if (z <= -4.6e+18) {
tmp = t_2;
} else if (z <= -3.3e-108) {
tmp = t_1;
} else if (z <= -4.8e-191) {
tmp = c;
} else if (z <= 5.8e-258) {
tmp = x * y;
} else if (z <= 5.5e-166) {
tmp = t_1;
} else if (z <= 3.7e-118) {
tmp = c;
} else if (z <= 1.9e-40) {
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 = (a * b) * (-0.25d0)
t_2 = 0.0625d0 * (z * t)
if (z <= (-4.6d+18)) then
tmp = t_2
else if (z <= (-3.3d-108)) then
tmp = t_1
else if (z <= (-4.8d-191)) then
tmp = c
else if (z <= 5.8d-258) then
tmp = x * y
else if (z <= 5.5d-166) then
tmp = t_1
else if (z <= 3.7d-118) then
tmp = c
else if (z <= 1.9d-40) 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 = (a * b) * -0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if (z <= -4.6e+18) {
tmp = t_2;
} else if (z <= -3.3e-108) {
tmp = t_1;
} else if (z <= -4.8e-191) {
tmp = c;
} else if (z <= 5.8e-258) {
tmp = x * y;
} else if (z <= 5.5e-166) {
tmp = t_1;
} else if (z <= 3.7e-118) {
tmp = c;
} else if (z <= 1.9e-40) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * -0.25 t_2 = 0.0625 * (z * t) tmp = 0 if z <= -4.6e+18: tmp = t_2 elif z <= -3.3e-108: tmp = t_1 elif z <= -4.8e-191: tmp = c elif z <= 5.8e-258: tmp = x * y elif z <= 5.5e-166: tmp = t_1 elif z <= 3.7e-118: tmp = c elif z <= 1.9e-40: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * -0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (z <= -4.6e+18) tmp = t_2; elseif (z <= -3.3e-108) tmp = t_1; elseif (z <= -4.8e-191) tmp = c; elseif (z <= 5.8e-258) tmp = Float64(x * y); elseif (z <= 5.5e-166) tmp = t_1; elseif (z <= 3.7e-118) tmp = c; elseif (z <= 1.9e-40) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * -0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if (z <= -4.6e+18) tmp = t_2; elseif (z <= -3.3e-108) tmp = t_1; elseif (z <= -4.8e-191) tmp = c; elseif (z <= 5.8e-258) tmp = x * y; elseif (z <= 5.5e-166) tmp = t_1; elseif (z <= 3.7e-118) tmp = c; elseif (z <= 1.9e-40) 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[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+18], t$95$2, If[LessEqual[z, -3.3e-108], t$95$1, If[LessEqual[z, -4.8e-191], c, If[LessEqual[z, 5.8e-258], N[(x * y), $MachinePrecision], If[LessEqual[z, 5.5e-166], t$95$1, If[LessEqual[z, 3.7e-118], c, If[LessEqual[z, 1.9e-40], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-191}:\\
\;\;\;\;c\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-258}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-118}:\\
\;\;\;\;c\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.6e18 or 1.8999999999999999e-40 < z Initial program 94.7%
associate-+l-94.7%
fma-def96.2%
*-commutative96.2%
associate-/l*96.1%
associate-/l*96.1%
Simplified96.1%
fma-udef94.6%
div-inv94.6%
clear-num94.7%
div-inv94.7%
metadata-eval94.7%
Applied egg-rr94.7%
Taylor expanded in t around inf 55.2%
if -4.6e18 < z < -3.3000000000000002e-108 or 5.7999999999999999e-258 < z < 5.4999999999999997e-166 or 3.70000000000000014e-118 < z < 1.8999999999999999e-40Initial program 99.9%
associate-+l-99.9%
fma-def99.9%
*-commutative99.9%
associate-/l*99.9%
associate-/l*99.9%
Simplified99.9%
fma-udef99.9%
div-inv99.9%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 35.8%
*-commutative35.8%
Simplified35.8%
if -3.3000000000000002e-108 < z < -4.7999999999999998e-191 or 5.4999999999999997e-166 < z < 3.70000000000000014e-118Initial program 92.8%
Taylor expanded in c around inf 38.6%
if -4.7999999999999998e-191 < z < 5.7999999999999999e-258Initial program 97.3%
associate-+l-97.3%
fma-def97.3%
*-commutative97.3%
associate-/l*97.3%
associate-/l*97.3%
Simplified97.3%
fma-udef97.3%
div-inv97.3%
clear-num97.3%
div-inv97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in x around inf 47.4%
Final simplification47.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+134)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 2e+143)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* b (* a -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+134) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+143) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (b * (a * -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) <= (-5d+134)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+143) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (b * (a * (-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) <= -5e+134) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+143) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+134: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 2e+143: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (b * (a * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+134) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+143) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(b * Float64(a * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+134) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 2e+143) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (b * (a * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+134], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+143], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+134}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+143}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999981e134Initial program 85.7%
Taylor expanded in z around 0 83.2%
Taylor expanded in c around 0 77.5%
if -4.99999999999999981e134 < (*.f64 a b) < 2e143Initial program 98.4%
Taylor expanded in a around 0 90.9%
if 2e143 < (*.f64 a b) Initial program 92.6%
Taylor expanded in a around inf 85.5%
associate-*r*85.5%
*-commutative85.5%
Simplified85.5%
Final simplification88.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+134)
(- (* x y) t_1)
(if (<= (* a b) 2e+167) (+ c (+ (* x y) t_2)) (- 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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+134) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 2e+167) {
tmp = c + ((x * y) + t_2);
} 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) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+134)) then
tmp = (x * y) - t_1
else if ((a * b) <= 2d+167) then
tmp = c + ((x * y) + t_2)
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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+134) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 2e+167) {
tmp = c + ((x * y) + t_2);
} 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 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+134: tmp = (x * y) - t_1 elif (a * b) <= 2e+167: tmp = c + ((x * y) + t_2) 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(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+134) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 2e+167) tmp = Float64(c + Float64(Float64(x * y) + t_2)); 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 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+134) tmp = (x * y) - t_1; elseif ((a * b) <= 2e+167) tmp = c + ((x * y) + t_2); 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+134], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+167], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], 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 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+134}:\\
\;\;\;\;x \cdot y - t_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+167}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999981e134Initial program 85.7%
Taylor expanded in z around 0 83.2%
Taylor expanded in c around 0 77.5%
if -4.99999999999999981e134 < (*.f64 a b) < 2.0000000000000001e167Initial program 98.4%
Taylor expanded in a around 0 91.0%
if 2.0000000000000001e167 < (*.f64 a b) Initial program 92.3%
Taylor expanded in x around 0 92.3%
Taylor expanded in c around 0 92.3%
Final simplification89.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+134)
(- (+ c (* x y)) t_1)
(if (<= (* a b) 2e+167) (+ c (+ (* x y) t_2)) (- 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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+134) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 2e+167) {
tmp = c + ((x * y) + t_2);
} 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) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+134)) then
tmp = (c + (x * y)) - t_1
else if ((a * b) <= 2d+167) then
tmp = c + ((x * y) + t_2)
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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+134) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 2e+167) {
tmp = c + ((x * y) + t_2);
} 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 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+134: tmp = (c + (x * y)) - t_1 elif (a * b) <= 2e+167: tmp = c + ((x * y) + t_2) 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(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+134) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(a * b) <= 2e+167) tmp = Float64(c + Float64(Float64(x * y) + t_2)); 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 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+134) tmp = (c + (x * y)) - t_1; elseif ((a * b) <= 2e+167) tmp = c + ((x * y) + t_2); 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+134], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+167], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], 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 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+134}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+167}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999981e134Initial program 85.7%
Taylor expanded in z around 0 83.2%
if -4.99999999999999981e134 < (*.f64 a b) < 2.0000000000000001e167Initial program 98.4%
Taylor expanded in a around 0 91.0%
if 2.0000000000000001e167 < (*.f64 a b) Initial program 92.3%
Taylor expanded in x around 0 92.3%
Taylor expanded in c around 0 92.3%
Final simplification90.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= y -4.5e-134)
(* x y)
(if (<= y -6.6e-196)
t_1
(if (<= y -1.8e-222)
c
(if (<= y 3.7e-174)
t_1
(if (<= y 2.1e-127) c (if (<= y 1.22e+160) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (y <= -4.5e-134) {
tmp = x * y;
} else if (y <= -6.6e-196) {
tmp = t_1;
} else if (y <= -1.8e-222) {
tmp = c;
} else if (y <= 3.7e-174) {
tmp = t_1;
} else if (y <= 2.1e-127) {
tmp = c;
} else if (y <= 1.22e+160) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (y <= (-4.5d-134)) then
tmp = x * y
else if (y <= (-6.6d-196)) then
tmp = t_1
else if (y <= (-1.8d-222)) then
tmp = c
else if (y <= 3.7d-174) then
tmp = t_1
else if (y <= 2.1d-127) then
tmp = c
else if (y <= 1.22d+160) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (y <= -4.5e-134) {
tmp = x * y;
} else if (y <= -6.6e-196) {
tmp = t_1;
} else if (y <= -1.8e-222) {
tmp = c;
} else if (y <= 3.7e-174) {
tmp = t_1;
} else if (y <= 2.1e-127) {
tmp = c;
} else if (y <= 1.22e+160) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if y <= -4.5e-134: tmp = x * y elif y <= -6.6e-196: tmp = t_1 elif y <= -1.8e-222: tmp = c elif y <= 3.7e-174: tmp = t_1 elif y <= 2.1e-127: tmp = c elif y <= 1.22e+160: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (y <= -4.5e-134) tmp = Float64(x * y); elseif (y <= -6.6e-196) tmp = t_1; elseif (y <= -1.8e-222) tmp = c; elseif (y <= 3.7e-174) tmp = t_1; elseif (y <= 2.1e-127) tmp = c; elseif (y <= 1.22e+160) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (y <= -4.5e-134) tmp = x * y; elseif (y <= -6.6e-196) tmp = t_1; elseif (y <= -1.8e-222) tmp = c; elseif (y <= 3.7e-174) tmp = t_1; elseif (y <= 2.1e-127) tmp = c; elseif (y <= 1.22e+160) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-134], N[(x * y), $MachinePrecision], If[LessEqual[y, -6.6e-196], t$95$1, If[LessEqual[y, -1.8e-222], c, If[LessEqual[y, 3.7e-174], t$95$1, If[LessEqual[y, 2.1e-127], c, If[LessEqual[y, 1.22e+160], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-134}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -6.6 \cdot 10^{-196}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-222}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-127}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -4.5000000000000005e-134 or 1.22e160 < y Initial program 93.9%
associate-+l-93.9%
fma-def95.6%
*-commutative95.6%
associate-/l*95.6%
associate-/l*95.5%
Simplified95.5%
fma-udef93.8%
div-inv93.8%
clear-num93.8%
div-inv93.8%
metadata-eval93.8%
Applied egg-rr93.8%
Taylor expanded in x around inf 43.9%
if -4.5000000000000005e-134 < y < -6.59999999999999997e-196 or -1.79999999999999987e-222 < y < 3.7000000000000001e-174 or 2.1000000000000001e-127 < y < 1.22e160Initial program 97.6%
associate-+l-97.6%
fma-def97.6%
*-commutative97.6%
associate-/l*97.5%
associate-/l*97.5%
Simplified97.5%
fma-udef97.5%
div-inv97.5%
clear-num97.6%
div-inv97.6%
metadata-eval97.6%
Applied egg-rr97.6%
Taylor expanded in t around inf 41.0%
if -6.59999999999999997e-196 < y < -1.79999999999999987e-222 or 3.7000000000000001e-174 < y < 2.1000000000000001e-127Initial program 100.0%
Taylor expanded in c around inf 53.9%
Final simplification43.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625)))))
(if (<= y -4.8e-134)
(+ c (* x y))
(if (<= y 2.6e+25)
t_1
(if (<= y 8.5e+121)
(+ c (* b (* a -0.25)))
(if (<= y 1.2e+138) t_1 (- (* x y) (* (* a b) 0.25))))))))
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 tmp;
if (y <= -4.8e-134) {
tmp = c + (x * y);
} else if (y <= 2.6e+25) {
tmp = t_1;
} else if (y <= 8.5e+121) {
tmp = c + (b * (a * -0.25));
} else if (y <= 1.2e+138) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = c + (z * (t * 0.0625d0))
if (y <= (-4.8d-134)) then
tmp = c + (x * y)
else if (y <= 2.6d+25) then
tmp = t_1
else if (y <= 8.5d+121) then
tmp = c + (b * (a * (-0.25d0)))
else if (y <= 1.2d+138) then
tmp = t_1
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 t_1 = c + (z * (t * 0.0625));
double tmp;
if (y <= -4.8e-134) {
tmp = c + (x * y);
} else if (y <= 2.6e+25) {
tmp = t_1;
} else if (y <= 8.5e+121) {
tmp = c + (b * (a * -0.25));
} else if (y <= 1.2e+138) {
tmp = t_1;
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) tmp = 0 if y <= -4.8e-134: tmp = c + (x * y) elif y <= 2.6e+25: tmp = t_1 elif y <= 8.5e+121: tmp = c + (b * (a * -0.25)) elif y <= 1.2e+138: tmp = t_1 else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) tmp = 0.0 if (y <= -4.8e-134) tmp = Float64(c + Float64(x * y)); elseif (y <= 2.6e+25) tmp = t_1; elseif (y <= 8.5e+121) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (y <= 1.2e+138) tmp = t_1; 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) t_1 = c + (z * (t * 0.0625)); tmp = 0.0; if (y <= -4.8e-134) tmp = c + (x * y); elseif (y <= 2.6e+25) tmp = t_1; elseif (y <= 8.5e+121) tmp = c + (b * (a * -0.25)); elseif (y <= 1.2e+138) tmp = t_1; else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-134], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+25], t$95$1, If[LessEqual[y, 8.5e+121], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+138], t$95$1, N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-134}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+121}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if y < -4.80000000000000019e-134Initial program 94.2%
Taylor expanded in x around inf 54.2%
if -4.80000000000000019e-134 < y < 2.5999999999999998e25 or 8.5e121 < y < 1.2e138Initial program 99.1%
Taylor expanded in z around inf 67.9%
associate-*r*67.9%
*-commutative67.9%
Simplified67.9%
if 2.5999999999999998e25 < y < 8.5e121Initial program 88.9%
Taylor expanded in a around inf 71.7%
associate-*r*71.7%
*-commutative71.7%
Simplified71.7%
if 1.2e138 < y Initial program 94.4%
Taylor expanded in z around 0 83.7%
Taylor expanded in c around 0 78.4%
Final simplification65.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625)))) (t_2 (+ c (* x y))))
(if (<= y -4.8e-134)
t_2
(if (<= y 4e+20)
t_1
(if (<= y 3.2e+120)
(+ c (* b (* a -0.25)))
(if (<= y 1.38e+160) 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 + (x * y);
double tmp;
if (y <= -4.8e-134) {
tmp = t_2;
} else if (y <= 4e+20) {
tmp = t_1;
} else if (y <= 3.2e+120) {
tmp = c + (b * (a * -0.25));
} else if (y <= 1.38e+160) {
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 + (z * (t * 0.0625d0))
t_2 = c + (x * y)
if (y <= (-4.8d-134)) then
tmp = t_2
else if (y <= 4d+20) then
tmp = t_1
else if (y <= 3.2d+120) then
tmp = c + (b * (a * (-0.25d0)))
else if (y <= 1.38d+160) 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 + (x * y);
double tmp;
if (y <= -4.8e-134) {
tmp = t_2;
} else if (y <= 4e+20) {
tmp = t_1;
} else if (y <= 3.2e+120) {
tmp = c + (b * (a * -0.25));
} else if (y <= 1.38e+160) {
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 + (x * y) tmp = 0 if y <= -4.8e-134: tmp = t_2 elif y <= 4e+20: tmp = t_1 elif y <= 3.2e+120: tmp = c + (b * (a * -0.25)) elif y <= 1.38e+160: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (y <= -4.8e-134) tmp = t_2; elseif (y <= 4e+20) tmp = t_1; elseif (y <= 3.2e+120) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (y <= 1.38e+160) 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 + (x * y); tmp = 0.0; if (y <= -4.8e-134) tmp = t_2; elseif (y <= 4e+20) tmp = t_1; elseif (y <= 3.2e+120) tmp = c + (b * (a * -0.25)); elseif (y <= 1.38e+160) 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[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-134], t$95$2, If[LessEqual[y, 4e+20], t$95$1, If[LessEqual[y, 3.2e+120], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.38e+160], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-134}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+120}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;y \leq 1.38 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -4.80000000000000019e-134 or 1.38e160 < y Initial program 93.9%
Taylor expanded in x around inf 58.5%
if -4.80000000000000019e-134 < y < 4e20 or 3.19999999999999982e120 < y < 1.38e160Initial program 99.1%
Taylor expanded in z around inf 66.0%
associate-*r*66.0%
*-commutative66.0%
Simplified66.0%
if 4e20 < y < 3.19999999999999982e120Initial program 88.9%
Taylor expanded in a around inf 71.7%
associate-*r*71.7%
*-commutative71.7%
Simplified71.7%
Final simplification63.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* z t))))
(if (<= z -3.2e+186)
t_2
(if (<= z -2e-50)
t_1
(if (<= z -3.4e-106) (* (* a b) -0.25) (if (<= z 1.35e-96) 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 = 0.0625 * (z * t);
double tmp;
if (z <= -3.2e+186) {
tmp = t_2;
} else if (z <= -2e-50) {
tmp = t_1;
} else if (z <= -3.4e-106) {
tmp = (a * b) * -0.25;
} else if (z <= 1.35e-96) {
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 = 0.0625d0 * (z * t)
if (z <= (-3.2d+186)) then
tmp = t_2
else if (z <= (-2d-50)) then
tmp = t_1
else if (z <= (-3.4d-106)) then
tmp = (a * b) * (-0.25d0)
else if (z <= 1.35d-96) 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 = 0.0625 * (z * t);
double tmp;
if (z <= -3.2e+186) {
tmp = t_2;
} else if (z <= -2e-50) {
tmp = t_1;
} else if (z <= -3.4e-106) {
tmp = (a * b) * -0.25;
} else if (z <= 1.35e-96) {
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 = 0.0625 * (z * t) tmp = 0 if z <= -3.2e+186: tmp = t_2 elif z <= -2e-50: tmp = t_1 elif z <= -3.4e-106: tmp = (a * b) * -0.25 elif z <= 1.35e-96: 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(0.0625 * Float64(z * t)) tmp = 0.0 if (z <= -3.2e+186) tmp = t_2; elseif (z <= -2e-50) tmp = t_1; elseif (z <= -3.4e-106) tmp = Float64(Float64(a * b) * -0.25); elseif (z <= 1.35e-96) 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 = 0.0625 * (z * t); tmp = 0.0; if (z <= -3.2e+186) tmp = t_2; elseif (z <= -2e-50) tmp = t_1; elseif (z <= -3.4e-106) tmp = (a * b) * -0.25; elseif (z <= 1.35e-96) 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+186], t$95$2, If[LessEqual[z, -2e-50], t$95$1, If[LessEqual[z, -3.4e-106], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], If[LessEqual[z, 1.35e-96], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+186}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-106}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-96}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.1999999999999999e186 or 1.35e-96 < z Initial program 97.3%
associate-+l-97.3%
fma-def97.3%
*-commutative97.3%
associate-/l*97.1%
associate-/l*97.1%
Simplified97.1%
fma-udef97.1%
div-inv97.2%
clear-num97.3%
div-inv97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in t around inf 52.3%
if -3.1999999999999999e186 < z < -2.00000000000000002e-50 or -3.39999999999999982e-106 < z < 1.35e-96Initial program 94.6%
Taylor expanded in x around inf 58.6%
if -2.00000000000000002e-50 < z < -3.39999999999999982e-106Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*99.8%
associate-/l*99.7%
Simplified99.7%
fma-udef99.7%
div-inv99.7%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 41.7%
*-commutative41.7%
Simplified41.7%
Final simplification54.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= y -4.8e-134) (not (<= y 9.6e+159))) (+ 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 ((y <= -4.8e-134) || !(y <= 9.6e+159)) {
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 ((y <= (-4.8d-134)) .or. (.not. (y <= 9.6d+159))) 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 ((y <= -4.8e-134) || !(y <= 9.6e+159)) {
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 (y <= -4.8e-134) or not (y <= 9.6e+159): 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 ((y <= -4.8e-134) || !(y <= 9.6e+159)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((y <= -4.8e-134) || ~((y <= 9.6e+159))) 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[y, -4.8e-134], N[Not[LessEqual[y, 9.6e+159]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-134} \lor \neg \left(y \leq 9.6 \cdot 10^{+159}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if y < -4.80000000000000019e-134 or 9.5999999999999999e159 < y Initial program 93.9%
Taylor expanded in x around inf 58.5%
if -4.80000000000000019e-134 < y < 9.5999999999999999e159Initial program 97.8%
Taylor expanded in z around inf 62.4%
associate-*r*62.4%
*-commutative62.4%
Simplified62.4%
Final simplification60.7%
(FPCore (x y z t a b c) :precision binary64 (if (<= x -1.22e+69) (* x y) (if (<= x 1.5e-80) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.22e+69) {
tmp = x * y;
} else if (x <= 1.5e-80) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (x <= (-1.22d+69)) then
tmp = x * y
else if (x <= 1.5d-80) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.22e+69) {
tmp = x * y;
} else if (x <= 1.5e-80) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -1.22e+69: tmp = x * y elif x <= 1.5e-80: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -1.22e+69) tmp = Float64(x * y); elseif (x <= 1.5e-80) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (x <= -1.22e+69) tmp = x * y; elseif (x <= 1.5e-80) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -1.22e+69], N[(x * y), $MachinePrecision], If[LessEqual[x, 1.5e-80], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{+69}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-80}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -1.22e69 or 1.50000000000000004e-80 < x Initial program 92.9%
associate-+l-92.9%
fma-def94.5%
*-commutative94.5%
associate-/l*94.4%
associate-/l*94.4%
Simplified94.4%
fma-udef92.9%
div-inv92.9%
clear-num92.9%
div-inv92.9%
metadata-eval92.9%
Applied egg-rr92.9%
Taylor expanded in x around inf 39.7%
if -1.22e69 < x < 1.50000000000000004e-80Initial program 99.2%
Taylor expanded in c around inf 29.9%
Final simplification34.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.1%
Taylor expanded in c around inf 22.6%
Final simplification22.6%
herbie shell --seed 2023279
(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))