
(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 (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-def98.0%
associate-*l/98.0%
fma-neg98.8%
sub-neg98.8%
distribute-neg-in98.8%
remove-double-neg98.8%
associate-/l*98.7%
distribute-frac-neg98.7%
associate-/r/98.8%
fma-def98.8%
neg-mul-198.8%
*-commutative98.8%
associate-/l*98.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (/ t (/ 16.0 z))) (- c (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (t / (16.0 / z))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(t / Float64(16.0 / z))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(t / N[(16.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 96.5%
associate-+l-96.5%
fma-def97.2%
*-commutative97.2%
associate-/l*97.2%
associate-/l*97.1%
Simplified97.1%
Final simplification97.1%
(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 (* (* a b) -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + ((a * b) * -0.25);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + ((a * b) * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + ((a * b) * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(Float64(a * b) * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + ((a * b) * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in a around inf 46.1%
*-commutative46.1%
Simplified46.1%
Final simplification98.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)))
(if (<= (* a b) -4.4e+125)
t_1
(if (<= (* a b) -5.6e-239)
c
(if (<= (* a b) 7.2e-306)
(* (* z t) 0.0625)
(if (<= (* a b) 1.45e-86)
(* x y)
(if (<= (* a b) 5e+18)
c
(if (<= (* a b) 1.15e+85) (* x y) t_1))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -4.4e+125) {
tmp = t_1;
} else if ((a * b) <= -5.6e-239) {
tmp = c;
} else if ((a * b) <= 7.2e-306) {
tmp = (z * t) * 0.0625;
} else if ((a * b) <= 1.45e-86) {
tmp = x * y;
} else if ((a * b) <= 5e+18) {
tmp = c;
} else if ((a * b) <= 1.15e+85) {
tmp = x * y;
} 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) <= (-4.4d+125)) then
tmp = t_1
else if ((a * b) <= (-5.6d-239)) then
tmp = c
else if ((a * b) <= 7.2d-306) then
tmp = (z * t) * 0.0625d0
else if ((a * b) <= 1.45d-86) then
tmp = x * y
else if ((a * b) <= 5d+18) then
tmp = c
else if ((a * b) <= 1.15d+85) then
tmp = x * y
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) <= -4.4e+125) {
tmp = t_1;
} else if ((a * b) <= -5.6e-239) {
tmp = c;
} else if ((a * b) <= 7.2e-306) {
tmp = (z * t) * 0.0625;
} else if ((a * b) <= 1.45e-86) {
tmp = x * y;
} else if ((a * b) <= 5e+18) {
tmp = c;
} else if ((a * b) <= 1.15e+85) {
tmp = x * y;
} 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) <= -4.4e+125: tmp = t_1 elif (a * b) <= -5.6e-239: tmp = c elif (a * b) <= 7.2e-306: tmp = (z * t) * 0.0625 elif (a * b) <= 1.45e-86: tmp = x * y elif (a * b) <= 5e+18: tmp = c elif (a * b) <= 1.15e+85: tmp = x * y 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) <= -4.4e+125) tmp = t_1; elseif (Float64(a * b) <= -5.6e-239) tmp = c; elseif (Float64(a * b) <= 7.2e-306) tmp = Float64(Float64(z * t) * 0.0625); elseif (Float64(a * b) <= 1.45e-86) tmp = Float64(x * y); elseif (Float64(a * b) <= 5e+18) tmp = c; elseif (Float64(a * b) <= 1.15e+85) tmp = Float64(x * y); 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) <= -4.4e+125) tmp = t_1; elseif ((a * b) <= -5.6e-239) tmp = c; elseif ((a * b) <= 7.2e-306) tmp = (z * t) * 0.0625; elseif ((a * b) <= 1.45e-86) tmp = x * y; elseif ((a * b) <= 5e+18) tmp = c; elseif ((a * b) <= 1.15e+85) tmp = x * y; 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], -4.4e+125], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5.6e-239], c, If[LessEqual[N[(a * b), $MachinePrecision], 7.2e-306], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.45e-86], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+18], c, If[LessEqual[N[(a * b), $MachinePrecision], 1.15e+85], N[(x * y), $MachinePrecision], 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 -4.4 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -5.6 \cdot 10^{-239}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq 7.2 \cdot 10^{-306}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\
\mathbf{elif}\;a \cdot b \leq 1.45 \cdot 10^{-86}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+18}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq 1.15 \cdot 10^{+85}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.39999999999999982e125 or 1.1499999999999999e85 < (*.f64 a b) Initial program 92.1%
associate-+l-92.1%
fma-def94.0%
*-commutative94.0%
associate-/l*94.0%
associate-/l*93.9%
Simplified93.9%
fma-udef91.9%
div-inv91.9%
clear-num91.9%
div-inv91.9%
metadata-eval91.9%
Applied egg-rr91.9%
Taylor expanded in a around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -4.39999999999999982e125 < (*.f64 a b) < -5.60000000000000025e-239 or 1.45e-86 < (*.f64 a b) < 5e18Initial program 98.7%
Taylor expanded in c around inf 40.6%
if -5.60000000000000025e-239 < (*.f64 a b) < 7.19999999999999982e-306Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*99.8%
associate-/l*99.8%
Simplified99.8%
fma-udef99.8%
div-inv100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 49.7%
if 7.19999999999999982e-306 < (*.f64 a b) < 1.45e-86 or 5e18 < (*.f64 a b) < 1.1499999999999999e85Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
fma-udef100.0%
div-inv100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 52.3%
Final simplification54.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y)))
(t_2 (+ c (* t (* z 0.0625))))
(t_3 (* (* a b) -0.25)))
(if (<= (* a b) -1.15e+151)
t_3
(if (<= (* a b) -8.2e-223)
t_1
(if (<= (* a b) 4.4e-307)
t_2
(if (<= (* a b) 9.2e+84) t_1 (if (<= (* a b) 2.7e+206) t_2 t_3)))))))
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 = c + (t * (z * 0.0625));
double t_3 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -1.15e+151) {
tmp = t_3;
} else if ((a * b) <= -8.2e-223) {
tmp = t_1;
} else if ((a * b) <= 4.4e-307) {
tmp = t_2;
} else if ((a * b) <= 9.2e+84) {
tmp = t_1;
} else if ((a * b) <= 2.7e+206) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (x * y)
t_2 = c + (t * (z * 0.0625d0))
t_3 = (a * b) * (-0.25d0)
if ((a * b) <= (-1.15d+151)) then
tmp = t_3
else if ((a * b) <= (-8.2d-223)) then
tmp = t_1
else if ((a * b) <= 4.4d-307) then
tmp = t_2
else if ((a * b) <= 9.2d+84) then
tmp = t_1
else if ((a * b) <= 2.7d+206) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = c + (t * (z * 0.0625));
double t_3 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -1.15e+151) {
tmp = t_3;
} else if ((a * b) <= -8.2e-223) {
tmp = t_1;
} else if ((a * b) <= 4.4e-307) {
tmp = t_2;
} else if ((a * b) <= 9.2e+84) {
tmp = t_1;
} else if ((a * b) <= 2.7e+206) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = c + (t * (z * 0.0625)) t_3 = (a * b) * -0.25 tmp = 0 if (a * b) <= -1.15e+151: tmp = t_3 elif (a * b) <= -8.2e-223: tmp = t_1 elif (a * b) <= 4.4e-307: tmp = t_2 elif (a * b) <= 9.2e+84: tmp = t_1 elif (a * b) <= 2.7e+206: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(c + Float64(t * Float64(z * 0.0625))) t_3 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -1.15e+151) tmp = t_3; elseif (Float64(a * b) <= -8.2e-223) tmp = t_1; elseif (Float64(a * b) <= 4.4e-307) tmp = t_2; elseif (Float64(a * b) <= 9.2e+84) tmp = t_1; elseif (Float64(a * b) <= 2.7e+206) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = c + (t * (z * 0.0625)); t_3 = (a * b) * -0.25; tmp = 0.0; if ((a * b) <= -1.15e+151) tmp = t_3; elseif ((a * b) <= -8.2e-223) tmp = t_1; elseif ((a * b) <= 4.4e-307) tmp = t_2; elseif ((a * b) <= 9.2e+84) tmp = t_1; elseif ((a * b) <= 2.7e+206) tmp = t_2; else tmp = t_3; 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[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.15e+151], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -8.2e-223], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 4.4e-307], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 9.2e+84], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2.7e+206], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_3 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -1.15 \cdot 10^{+151}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 4.4 \cdot 10^{-307}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 9.2 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{+206}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 a b) < -1.15e151 or 2.70000000000000003e206 < (*.f64 a b) Initial program 89.5%
associate-+l-89.5%
fma-def92.1%
*-commutative92.1%
associate-/l*92.1%
associate-/l*91.9%
Simplified91.9%
fma-udef89.3%
div-inv89.3%
clear-num89.3%
div-inv89.3%
metadata-eval89.3%
Applied egg-rr89.3%
Taylor expanded in a around inf 80.2%
*-commutative80.2%
Simplified80.2%
if -1.15e151 < (*.f64 a b) < -8.2000000000000003e-223 or 4.4e-307 < (*.f64 a b) < 9.1999999999999996e84Initial program 99.2%
Taylor expanded in x around inf 71.2%
if -8.2000000000000003e-223 < (*.f64 a b) < 4.4e-307 or 9.1999999999999996e84 < (*.f64 a b) < 2.70000000000000003e206Initial program 100.0%
Taylor expanded in z around inf 66.6%
associate-*r*66.6%
*-commutative66.6%
associate-*r*66.6%
Simplified66.6%
Final simplification72.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* (* a b) -0.25))))
(if (<= (* x y) -1.92e+170)
(+ c (* x y))
(if (<= (* x y) -4e-105)
t_1
(if (<= (* x y) 2.3e-279)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 3.8e+133) t_1 (+ (* x y) (* (* z t) 0.0625))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((a * b) * -0.25);
double tmp;
if ((x * y) <= -1.92e+170) {
tmp = c + (x * y);
} else if ((x * y) <= -4e-105) {
tmp = t_1;
} else if ((x * y) <= 2.3e-279) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 3.8e+133) {
tmp = t_1;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = c + ((a * b) * (-0.25d0))
if ((x * y) <= (-1.92d+170)) then
tmp = c + (x * y)
else if ((x * y) <= (-4d-105)) then
tmp = t_1
else if ((x * y) <= 2.3d-279) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 3.8d+133) then
tmp = t_1
else
tmp = (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 t_1 = c + ((a * b) * -0.25);
double tmp;
if ((x * y) <= -1.92e+170) {
tmp = c + (x * y);
} else if ((x * y) <= -4e-105) {
tmp = t_1;
} else if ((x * y) <= 2.3e-279) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 3.8e+133) {
tmp = t_1;
} else {
tmp = (x * y) + ((z * t) * 0.0625);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + ((a * b) * -0.25) tmp = 0 if (x * y) <= -1.92e+170: tmp = c + (x * y) elif (x * y) <= -4e-105: tmp = t_1 elif (x * y) <= 2.3e-279: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 3.8e+133: tmp = t_1 else: tmp = (x * y) + ((z * t) * 0.0625) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(Float64(a * b) * -0.25)) tmp = 0.0 if (Float64(x * y) <= -1.92e+170) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= -4e-105) tmp = t_1; elseif (Float64(x * y) <= 2.3e-279) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 3.8e+133) tmp = t_1; else tmp = 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) t_1 = c + ((a * b) * -0.25); tmp = 0.0; if ((x * y) <= -1.92e+170) tmp = c + (x * y); elseif ((x * y) <= -4e-105) tmp = t_1; elseif ((x * y) <= 2.3e-279) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 3.8e+133) tmp = t_1; else tmp = (x * y) + ((z * t) * 0.0625); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.92e+170], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-105], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.3e-279], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.8e+133], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;x \cdot y \leq -1.92 \cdot 10^{+170}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2.3 \cdot 10^{-279}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9199999999999999e170Initial program 92.5%
Taylor expanded in x around inf 80.4%
if -1.9199999999999999e170 < (*.f64 x y) < -3.99999999999999986e-105 or 2.29999999999999995e-279 < (*.f64 x y) < 3.8000000000000002e133Initial program 98.2%
Taylor expanded in a around inf 70.3%
*-commutative70.3%
Simplified70.3%
if -3.99999999999999986e-105 < (*.f64 x y) < 2.29999999999999995e-279Initial program 96.9%
Taylor expanded in z around inf 66.6%
associate-*r*66.6%
*-commutative66.6%
associate-*r*66.6%
Simplified66.6%
if 3.8000000000000002e133 < (*.f64 x y) Initial program 94.7%
Taylor expanded in a around 0 82.3%
Taylor expanded in c around 0 77.1%
Final simplification71.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* (* a b) -0.25))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1.16e+169)
t_2
(if (<= (* x y) -2.3e-107)
t_1
(if (<= (* x y) 3.2e-281)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 5.5e+135) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((a * b) * -0.25);
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.16e+169) {
tmp = t_2;
} else if ((x * y) <= -2.3e-107) {
tmp = t_1;
} else if ((x * y) <= 3.2e-281) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 5.5e+135) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + ((a * b) * (-0.25d0))
t_2 = c + (x * y)
if ((x * y) <= (-1.16d+169)) then
tmp = t_2
else if ((x * y) <= (-2.3d-107)) then
tmp = t_1
else if ((x * y) <= 3.2d-281) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 5.5d+135) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((a * b) * -0.25);
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.16e+169) {
tmp = t_2;
} else if ((x * y) <= -2.3e-107) {
tmp = t_1;
} else if ((x * y) <= 3.2e-281) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 5.5e+135) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + ((a * b) * -0.25) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1.16e+169: tmp = t_2 elif (x * y) <= -2.3e-107: tmp = t_1 elif (x * y) <= 3.2e-281: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 5.5e+135: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(Float64(a * b) * -0.25)) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.16e+169) tmp = t_2; elseif (Float64(x * y) <= -2.3e-107) tmp = t_1; elseif (Float64(x * y) <= 3.2e-281) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 5.5e+135) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + ((a * b) * -0.25); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.16e+169) tmp = t_2; elseif ((x * y) <= -2.3e-107) tmp = t_1; elseif ((x * y) <= 3.2e-281) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 5.5e+135) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.16e+169], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e-107], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e-281], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.5e+135], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + \left(a \cdot b\right) \cdot -0.25\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.16 \cdot 10^{+169}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-281}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.16e169 or 5.4999999999999999e135 < (*.f64 x y) Initial program 93.6%
Taylor expanded in x around inf 76.1%
if -1.16e169 < (*.f64 x y) < -2.30000000000000003e-107 or 3.2000000000000001e-281 < (*.f64 x y) < 5.4999999999999999e135Initial program 98.2%
Taylor expanded in a around inf 70.3%
*-commutative70.3%
Simplified70.3%
if -2.30000000000000003e-107 < (*.f64 x y) < 3.2000000000000001e-281Initial program 96.9%
Taylor expanded in z around inf 66.6%
associate-*r*66.6%
*-commutative66.6%
associate-*r*66.6%
Simplified66.6%
Final simplification71.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (or (<= (* x y) -1.18e+97) (not (<= (* x y) 1.75e+155)))
(- (+ c (* x y)) t_1)
(- (+ c (* (* z t) 0.0625)) 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 (((x * y) <= -1.18e+97) || !((x * y) <= 1.75e+155)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - 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 (((x * y) <= (-1.18d+97)) .or. (.not. ((x * y) <= 1.75d+155))) then
tmp = (c + (x * y)) - t_1
else
tmp = (c + ((z * t) * 0.0625d0)) - 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 (((x * y) <= -1.18e+97) || !((x * y) <= 1.75e+155)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if ((x * y) <= -1.18e+97) or not ((x * y) <= 1.75e+155): tmp = (c + (x * y)) - t_1 else: tmp = (c + ((z * t) * 0.0625)) - 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(x * y) <= -1.18e+97) || !(Float64(x * y) <= 1.75e+155)) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(c + Float64(Float64(z * t) * 0.0625)) - 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 (((x * y) <= -1.18e+97) || ~(((x * y) <= 1.75e+155))) tmp = (c + (x * y)) - t_1; else tmp = (c + ((z * t) * 0.0625)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.18e+97], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.75e+155]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -1.18 \cdot 10^{+97} \lor \neg \left(x \cdot y \leq 1.75 \cdot 10^{+155}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + \left(z \cdot t\right) \cdot 0.0625\right) - t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.18000000000000006e97 or 1.74999999999999992e155 < (*.f64 x y) Initial program 93.2%
Taylor expanded in z around 0 88.7%
if -1.18000000000000006e97 < (*.f64 x y) < 1.74999999999999992e155Initial program 98.2%
Taylor expanded in x around 0 94.0%
Final simplification92.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -7.8e+85)
(* x y)
(if (<= (* x y) -1.52e-49)
c
(if (<= (* x y) 9.6e-107)
(* (* z t) 0.0625)
(if (<= (* x y) 2.5e+163) c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -7.8e+85) {
tmp = x * y;
} else if ((x * y) <= -1.52e-49) {
tmp = c;
} else if ((x * y) <= 9.6e-107) {
tmp = (z * t) * 0.0625;
} else if ((x * y) <= 2.5e+163) {
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 * y) <= (-7.8d+85)) then
tmp = x * y
else if ((x * y) <= (-1.52d-49)) then
tmp = c
else if ((x * y) <= 9.6d-107) then
tmp = (z * t) * 0.0625d0
else if ((x * y) <= 2.5d+163) 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 * y) <= -7.8e+85) {
tmp = x * y;
} else if ((x * y) <= -1.52e-49) {
tmp = c;
} else if ((x * y) <= 9.6e-107) {
tmp = (z * t) * 0.0625;
} else if ((x * y) <= 2.5e+163) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -7.8e+85: tmp = x * y elif (x * y) <= -1.52e-49: tmp = c elif (x * y) <= 9.6e-107: tmp = (z * t) * 0.0625 elif (x * y) <= 2.5e+163: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -7.8e+85) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.52e-49) tmp = c; elseif (Float64(x * y) <= 9.6e-107) tmp = Float64(Float64(z * t) * 0.0625); elseif (Float64(x * y) <= 2.5e+163) 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 * y) <= -7.8e+85) tmp = x * y; elseif ((x * y) <= -1.52e-49) tmp = c; elseif ((x * y) <= 9.6e-107) tmp = (z * t) * 0.0625; elseif ((x * y) <= 2.5e+163) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -7.8e+85], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.52e-49], c, If[LessEqual[N[(x * y), $MachinePrecision], 9.6e-107], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+163], c, N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.8 \cdot 10^{+85}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.52 \cdot 10^{-49}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 9.6 \cdot 10^{-107}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+163}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.80000000000000067e85 or 2.5e163 < (*.f64 x y) Initial program 93.3%
associate-+l-93.3%
fma-def95.6%
*-commutative95.6%
associate-/l*95.6%
associate-/l*95.5%
Simplified95.5%
fma-udef93.3%
div-inv93.3%
clear-num93.3%
div-inv93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Taylor expanded in x around inf 66.2%
if -7.80000000000000067e85 < (*.f64 x y) < -1.52e-49 or 9.59999999999999977e-107 < (*.f64 x y) < 2.5e163Initial program 99.9%
Taylor expanded in c around inf 44.5%
if -1.52e-49 < (*.f64 x y) < 9.59999999999999977e-107Initial program 97.1%
associate-+l-97.1%
fma-def97.1%
*-commutative97.1%
associate-/l*97.0%
associate-/l*96.9%
Simplified96.9%
fma-udef96.9%
div-inv97.0%
clear-num97.0%
div-inv97.0%
metadata-eval97.0%
Applied egg-rr97.0%
Taylor expanded in t around inf 36.8%
Final simplification49.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -9e+162) (not (<= (* a b) 3.9e+204))) (- (* 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) <= -9e+162) || !((a * b) <= 3.9e+204)) {
tmp = (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) <= (-9d+162)) .or. (.not. ((a * b) <= 3.9d+204))) then
tmp = (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) <= -9e+162) || !((a * b) <= 3.9e+204)) {
tmp = (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) <= -9e+162) or not ((a * b) <= 3.9e+204): tmp = (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) <= -9e+162) || !(Float64(a * b) <= 3.9e+204)) tmp = 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) <= -9e+162) || ~(((a * b) <= 3.9e+204))) tmp = (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], -9e+162], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3.9e+204]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9 \cdot 10^{+162} \lor \neg \left(a \cdot b \leq 3.9 \cdot 10^{+204}\right):\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -8.99999999999999944e162 or 3.90000000000000017e204 < (*.f64 a b) Initial program 88.9%
Taylor expanded in z around 0 89.0%
Taylor expanded in c around 0 88.3%
if -8.99999999999999944e162 < (*.f64 a b) < 3.90000000000000017e204Initial program 99.4%
Taylor expanded in a around 0 91.1%
Final simplification90.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* (* z t) 0.0625)))
(if (<= (* a b) -2.4e+127)
(- t_2 t_1)
(if (<= (* a b) 1.86e+205) (+ c (+ (* x y) t_2)) (- (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -2.4e+127) {
tmp = t_2 - t_1;
} else if ((a * b) <= 1.86e+205) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = (z * t) * 0.0625d0
if ((a * b) <= (-2.4d+127)) then
tmp = t_2 - t_1
else if ((a * b) <= 1.86d+205) then
tmp = c + ((x * y) + t_2)
else
tmp = (x * y) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -2.4e+127) {
tmp = t_2 - t_1;
} else if ((a * b) <= 1.86e+205) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (x * y) - 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 tmp = 0 if (a * b) <= -2.4e+127: tmp = t_2 - t_1 elif (a * b) <= 1.86e+205: tmp = c + ((x * y) + t_2) else: tmp = (x * y) - 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) tmp = 0.0 if (Float64(a * b) <= -2.4e+127) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 1.86e+205) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(x * y) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = (z * t) * 0.0625; tmp = 0.0; if ((a * b) <= -2.4e+127) tmp = t_2 - t_1; elseif ((a * b) <= 1.86e+205) tmp = c + ((x * y) + t_2); else tmp = (x * y) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.4e+127], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.86e+205], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - 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\\
\mathbf{if}\;a \cdot b \leq -2.4 \cdot 10^{+127}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;a \cdot b \leq 1.86 \cdot 10^{+205}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.4000000000000002e127Initial program 89.6%
Taylor expanded in x around 0 87.8%
Taylor expanded in c around 0 86.9%
if -2.4000000000000002e127 < (*.f64 a b) < 1.8600000000000001e205Initial program 99.4%
Taylor expanded in a around 0 91.9%
if 1.8600000000000001e205 < (*.f64 a b) Initial program 90.0%
Taylor expanded in z around 0 93.3%
Taylor expanded in c around 0 93.3%
Final simplification91.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* (* z t) 0.0625)))
(if (<= (* a b) -5.2e+127)
(- t_2 t_1)
(if (<= (* a b) 1.4e+135) (+ c (+ (* x y) t_2)) (- (+ c (* x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5.2e+127) {
tmp = t_2 - t_1;
} else if ((a * b) <= 1.4e+135) {
tmp = c + ((x * y) + t_2);
} 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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = (z * t) * 0.0625d0
if ((a * b) <= (-5.2d+127)) then
tmp = t_2 - t_1
else if ((a * b) <= 1.4d+135) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + (x * y)) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5.2e+127) {
tmp = t_2 - t_1;
} else if ((a * b) <= 1.4e+135) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + (x * y)) - 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 tmp = 0 if (a * b) <= -5.2e+127: tmp = t_2 - t_1 elif (a * b) <= 1.4e+135: tmp = c + ((x * y) + t_2) else: tmp = (c + (x * y)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (Float64(a * b) <= -5.2e+127) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 1.4e+135) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + Float64(x * y)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = (z * t) * 0.0625; tmp = 0.0; if ((a * b) <= -5.2e+127) tmp = t_2 - t_1; elseif ((a * b) <= 1.4e+135) tmp = c + ((x * y) + t_2); else tmp = (c + (x * y)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5.2e+127], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.4e+135], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+127}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;a \cdot b \leq 1.4 \cdot 10^{+135}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.2000000000000004e127Initial program 89.6%
Taylor expanded in x around 0 87.8%
Taylor expanded in c around 0 86.9%
if -5.2000000000000004e127 < (*.f64 a b) < 1.40000000000000001e135Initial program 99.4%
Taylor expanded in a around 0 94.1%
if 1.40000000000000001e135 < (*.f64 a b) Initial program 93.2%
Taylor expanded in z around 0 88.7%
Final simplification91.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3.6e+96) (not (<= (* x y) 2.7e+163))) (- (* x y) (* (* a b) 0.25)) (+ c (* (* a b) -0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -3.6e+96) || !((x * y) <= 2.7e+163)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + ((a * b) * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-3.6d+96)) .or. (.not. ((x * y) <= 2.7d+163))) then
tmp = (x * y) - ((a * b) * 0.25d0)
else
tmp = c + ((a * b) * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -3.6e+96) || !((x * y) <= 2.7e+163)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + ((a * b) * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -3.6e+96) or not ((x * y) <= 2.7e+163): tmp = (x * y) - ((a * b) * 0.25) else: tmp = c + ((a * b) * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -3.6e+96) || !(Float64(x * y) <= 2.7e+163)) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(a * b) * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -3.6e+96) || ~(((x * y) <= 2.7e+163))) tmp = (x * y) - ((a * b) * 0.25); else tmp = c + ((a * b) * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -3.6e+96], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.7e+163]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.6 \cdot 10^{+96} \lor \neg \left(x \cdot y \leq 2.7 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -3.60000000000000013e96 or 2.69999999999999999e163 < (*.f64 x y) Initial program 93.1%
Taylor expanded in z around 0 88.6%
Taylor expanded in c around 0 82.8%
if -3.60000000000000013e96 < (*.f64 x y) < 2.69999999999999999e163Initial program 98.2%
Taylor expanded in a around inf 66.0%
*-commutative66.0%
Simplified66.0%
Final simplification71.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -9.5e+150) (not (<= (* a b) 1e+181))) (* (* a b) -0.25) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -9.5e+150) || !((a * b) <= 1e+181)) {
tmp = (a * b) * -0.25;
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-9.5d+150)) .or. (.not. ((a * b) <= 1d+181))) then
tmp = (a * b) * (-0.25d0)
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -9.5e+150) || !((a * b) <= 1e+181)) {
tmp = (a * b) * -0.25;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -9.5e+150) or not ((a * b) <= 1e+181): tmp = (a * b) * -0.25 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -9.5e+150) || !(Float64(a * b) <= 1e+181)) tmp = Float64(Float64(a * b) * -0.25); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -9.5e+150) || ~(((a * b) <= 1e+181))) tmp = (a * b) * -0.25; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -9.5e+150], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+181]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+150} \lor \neg \left(a \cdot b \leq 10^{+181}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -9.5000000000000001e150 or 9.9999999999999992e180 < (*.f64 a b) Initial program 89.7%
associate-+l-89.7%
fma-def92.3%
*-commutative92.3%
associate-/l*92.3%
associate-/l*92.1%
Simplified92.1%
fma-udef89.6%
div-inv89.6%
clear-num89.6%
div-inv89.6%
metadata-eval89.6%
Applied egg-rr89.6%
Taylor expanded in a around inf 79.4%
*-commutative79.4%
Simplified79.4%
if -9.5000000000000001e150 < (*.f64 a b) < 9.9999999999999992e180Initial program 99.4%
Taylor expanded in x around inf 64.4%
Final simplification69.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -2e+75) (* x y) (if (<= (* x y) 2.7e+163) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2e+75) {
tmp = x * y;
} else if ((x * y) <= 2.7e+163) {
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 * y) <= (-2d+75)) then
tmp = x * y
else if ((x * y) <= 2.7d+163) 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 * y) <= -2e+75) {
tmp = x * y;
} else if ((x * y) <= 2.7e+163) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -2e+75: tmp = x * y elif (x * y) <= 2.7e+163: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -2e+75) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.7e+163) 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 * y) <= -2e+75) tmp = x * y; elseif ((x * y) <= 2.7e+163) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+75], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.7e+163], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+75}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{+163}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999985e75 or 2.69999999999999999e163 < (*.f64 x y) Initial program 93.3%
associate-+l-93.3%
fma-def95.6%
*-commutative95.6%
associate-/l*95.6%
associate-/l*95.5%
Simplified95.5%
fma-udef93.3%
div-inv93.3%
clear-num93.3%
div-inv93.3%
metadata-eval93.3%
Applied egg-rr93.3%
Taylor expanded in x around inf 66.2%
if -1.99999999999999985e75 < (*.f64 x y) < 2.69999999999999999e163Initial program 98.2%
Taylor expanded in c around inf 31.7%
Final simplification43.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%
Taylor expanded in c around inf 23.1%
Final simplification23.1%
herbie shell --seed 2023275
(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))